teleren/devto huggingface dataset:
Using GitHub's Contribution Graph as a Desktop Background
Tags: github, ricing
Published: 2023-04-03 16:15:00

## Introduction
As developers, we take pride in our GitHub contribution graph, showcasing our commitment to open-source projects and personal coding projects. But have you ever thought about using your contribution graph in a different way? In this post, I will show you how to generate a customized desktop background image using your contribution graph.

## Generating Background Image

### Install Package
To make it easy to use, I have packaged the tool as an npm package. Simply install it by running the following command:
```sh
npm install -g @jckimble/github-graph-background
```

### Run Github Graph Background
My favorite theme is fullrandom:dark, which uses all the other themes with a dark background. Run the tool by executing the following command in your terminal:
```sh
github-graph-background --token ${GITHUB_TOKEN} --theme fullrandom:dark
```

### Create a script
Here's an example script that I use for Plasma:
```bash
#!/bin/bash

CACHE=${HOME}/.cache

if [ -z "$GITHUB_TOKEN" ]; then
	echo "GITHUB_TOKEN must be set"
	exit 1
fi

test -f "${CACHE}/background.png" && mv ${CACHE}/background.png ${CACHE}/background.old.png
test -f "${CACHE}/background.old.png" && plasma-apply-wallpaperimage ${CACHE}/background.old.png

npx @jckimble/github-graph-background --theme random:dark --output ${CACHE}/background.png

plasma-apply-wallpaperimage ${CACHE}/background.png
test -f "${CACHE}/background.old.png" && rm ${CACHE}/background.old.png
```


## Why Developers are Proud of Their Contribution Graph
Developers take pride in their contribution graph because it reflects the number of commits and contributions made over time. A filled-in graph demonstrates a high level of activity and dedication to coding, which is something that we strive for as developers. The contribution graph is a tangible representation of our commitment to the community and making a positive impact.

## Conclusion
Creating a custom desktop background using your GitHub contribution graph is a fun and unique way to showcase your coding skills and dedication to the community. By following the steps outlined in this post, you can create a personalized desktop background that reflects your commitment to coding. Give it a try and let me know how it turns out!
Why aren’t you contributing to open source?
Tags: codenewbie, discuss, webdev, opensource
Published: 2023-04-03 16:12:03

---
title: Why aren’t you contributing to open source?
published: true
description: 
tags: CodeNewbie, discuss, webdev, opensource
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-04-03 16:08 +0000
---
Contributing to open source can be one of the best ways to start or advance your career. But there are often barriers to getting started in Open Source. What are some of the reasons that prevented you from getting started in OSS?
Solving Java Multithreading Challenges in My Google Photos Clone
Tags: java, webdev, backend
Published: 2023-04-03 16:10:14

[In this video](https://youtu.be/VtpNcdjjwdA) we want to turn our Google Photos clone from single-threaded to multi-threaded, to generate thumbnails much faster than before. 

But there are a couple of challenges along the way. We'll learn that using Java's Parallel File Streams seems to be a buggy endeavor, so we'll fall back on good, old ExecutorServices. 

But how many threads should we use to generate thumbnails? How can threads get in conflict with each other? How do we make our program fail-safe for threading issues? 

Watch to find out!

{% embed https://youtu.be/VtpNcdjjwdA %}
Conditional Statements in JavaScript: If-Else
Tags: javascript, webdev, programming, codenewbie
Published: 2023-04-03 15:59:18

Conditional statements are used in programming to used execute specific code based on certain conditions. In JavaScript, if else execute based on the return value of the conditional statement.

## [The If-Else Statement](https://www.programdoc.com/javascript/if-else)

_syntax:_
```js
if (condition) {
  // execute this block of code if condition is true
} else {
  // execute this block of code if condition is false
}
``` 

Here, `condition` is an expression that evaluates to either `true` or `false`. If `condition` is `true`, the code inside the first set of curly braces will be executed. If `condition` is `false`, the code inside the second set of curly braces will be executed.

### Example:

```js
let score = 40;

if (age >= 40) {
  console.log("You scored above 40");
} else {
  console.log("You scored below 40");
}
``` 

In this example, if `score` is greater than or equal to `40`, the message "You scored above 40" will be printed to the console. If `score` is less than `40`, the message "You scored below 40" will be printed.

## The If-Else If Statement

The `if-else if` statement can be used when there are multiple conditions that need to be evaluated. 

_syntax:_
```js
if (condition1) {
  // code to be executed if condition1 is true
} else if (condition2) {
  // code to be executed if condition2 is true
} else {
  // code to be executed if all conditions are false
}
``` 

Here, if `condition1` is `true`, the code inside the first set of curly braces will be executed. If `condition1` is `false` and `condition2` is `true`, the code inside the second set of curly braces will be executed. If both `condition1` and `condition2` are `false`, the code inside the third set of curly braces will be executed.

### Example:
```js
let volt = 150;

if (volt >= 200) {
  console.log("Voltage above 200");
} else if (volt >= 175) {
  console.log("Voltage above 175");
} else if (volt >= 150) {
  console.log("Voltage above 150");
} else if (volt >= 100) {
  console.log("Voltage above 100");
} else {
  console.log("Voltage below 100");
}
``` 
In this example, while check the volt value in `if else if` statement third one is valid,  `Voltage above 150` will be printed in the console. Condition below the statement are valid but it won't execute because the one if statement is already valid.
How to create a read-only GraphQL server
Tags: graphql, readonly, api
Published: 2023-04-03 15:56:32

At Woovi, we have a console/back-office to manage all our operations. We would like to give access to it for all our developers to make their support life easier, but we do not want to reduce our security.
Our console access is permission based, each user has some roles that give them access to some features.
If a user does not have any role, we want to make sure it can only read the data, but they can't modify any data.

## Using GraphQL middlewares to make a read-only API

GraphQL provides some meta information where we can check if the request is a query or mutation and which mutation is being requested.

We added a middleware to intercept a GraphQL operation that checks if the request is a mutation and the user has the permission to execute them.

The code is shown below:

```jsx
export const adminOnlyMutation =
  (allowListMutations: string[] = []) =>
  (
    root: any,
    args: { [argName: string]: any },
    context: GraphQLContext,
    info: GraphQLResolveInfo,
    next: () => void,
  ) => {
    const mutationType = info.schema.getMutationType();

    if (allowListMutations.includes(info.fieldName)) {
      return next();
    }

    if (!mutationType) {
      return next();
    }

    if (context?.user?.roles?.includes('ADMIN')) {
      return next();
    }

    const fields = info.returnType.getFields();

    if (fields.error && fields.error.type === GraphQLString) {
      return {
        error: context.t('User not allowed'),
      };
    }

    throw new Error(context.t('User not allowed'));
  };
```

Usage

```jsx
import { addMiddleware } from 'graphql-add-middleware';

export const allowListMutations = ['UserLogin'];

addMiddleware(schema, 'Mutation', adminOnlyMutation(allowListMutations));

```

## In Conclusion
GraphQL middleware is a powerful way to modify your GraphQL schema. 
Making a read-only API using REST would take more work, as you need to manage many endpoints.
You can do that in a few lines of code in GraphQL.


---
Woovi
[Woovi](https://www.woovi.com) is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.

If you want to work with us, we are [hiring](https://woovi.com/jobs/)!

---
Photo by <a href="https://unsplash.com/@iamromankraft?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Roman Kraft</a> on <a href="https://unsplash.com/photos/_Zua2hyvTBk?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Deploy a static website with S3 and CloudFront using Terraform
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-04-03 15:53:13

[93/100] #100DaysOfCloud Today, I deployed a static website with S3 and CloudFront using Terraform.

I have done this using the console as well and if you would like to check it out then [click here](https://dev.to/aaditunni/hosting-a-static-website-with-s3-cloudfront-29km)

You can try do it by yourself by following the steps from the link below: [GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/093/Readme.md)
Java Collection Framework — 1
Tags: programming, tutorial, java, java8
Published: 2023-04-03 15:15:51


## Java Collection Framework — 1

We all know the importance of data structures, right? Data structures help in organizing, storing, and processing data.

There are many well-known data structures like —
>  Array
>  2. Queue
>  3. Stack
>  4. Map

## **How do we store data?**

In any programming language, variables are probably the most basic way to store data either temporarily or long-term.
>  In Java, we can use **primitive variables** to store or hold primitive values. To store objects, we use **reference variables.**

Let’s say we have to create and store an Employee object. To do that, we will do something like below:

    Employee emp = new Employee();

That’s fine to handle a single object.

But, what if we have to store 100 Employee objects?

You’d say — why not use Arrays? Well — yes, we can and we will use an array to store 100 Employee objects.

    Employee[] manyEmployees = new Employee[100];
>  We just used **Array** which is one of oldest, fastest, and well-known data structures.

## But, do you see the problem?

Array is a fixed-size data structure, isn’t it? What if our code at runtime produced 101 employees? Would our array be able to store 101 employees?

You guessed it right — no, it won’t be able to automatically.

To do that, we’ll have to create a new bigger array and then copy all objects from the old array to the new array.

Now, you see the problem, right? It’s the overhead of creating bigger array and copying elements.

In such cases — what we need is a dynamic array that can do this automatically.

But, how do we do that? You’d say — we can implement a dynamic array ourselves.

## There’s more!

What if we need Stack or maybe a Queue? Well — implement few more classes from scratch, right?

**I hope you see the bigger problem now.**

It’s a common problem and developers across the world will be developing the same things on their own, reinventing the wheel again and again!

## Collections to the rescue

Java language designers saw this problem and they worked and developed various data structures which we can find in JDK.

Java Collection framework is a set of interfaces and classes which provides different ready-to-use data structures so that we don’t have to reinvent the wheel.

You need a list, you can find one in JDK API. You need a map, just use the Map from JDK API.

## Collection framework outline

![](https://cdn-images-1.medium.com/max/4384/1*2EId7zgKUnQ2OcInhROk3Q.png)

Just a different way to show the same thing.

![](https://cdn-images-1.medium.com/max/5040/1*4O7xO0L0b_mXqVyVsIKb7g.png)

It’s just a very high level overview of Java Collection Framework. There’s much more to cover.

If you liked the article, please give a thumbs-up and subscribe my YouTube channel where I will be uploading a new playlist on Collections [https://www.youtube.com/@therealdumbprogrammer/featured](https://www.youtube.com/@therealdumbprogrammer/featured)

Happy learning!
What does the error "cannot delete Pods with local storage" mean ?
Tags: devops, kubernetes, sre
Published: 2023-04-03 15:26:00

While we are doing Kubernetes cluster updates, or we simply want to clean a node before deleting it, we can have the error "**cannot delete Pods with local storage".

```bash
$ kubectl drain node-1 --ignore-daemonsets
...
error: cannot delete Pods with local storage (use --delete-emptydir-data to override):
```

The solution is quite simple and is already noted in the error log. We just have to add the option `--delete-emptydir-data` to your command to make it work.

But what does it mean ?

---

## Error explaination
This error want to show you that you have some pods *(which are on the node you want to clean)* have **local storage** as **emptyDir**.

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: my-pod
spec:
  containers:
  - image: busybox
    name: busybox
    volumeMounts:
    - mountPath: /data
      name: my-volume
  volumes:
  - name: my-volume
    emptyDir: {}
```
Using an **emptyDir** volume is something which must be understand to avoid this kind of issue.

An **emptyDir** volume only exists on the node where the related pod is. Contrary to the pods, it won't be moved to a new node, but it will be **destroyed**, before being **recreated** on the new node.
It means that all the data which are on the "old" node will be **deleted**.

It is for this reason that we must be conscious about what is an **emptyDir** volume. If you are using this for a database, you may be able to do something manually to extract the data and migrate it to the new node. But you won't be able to always do it. Some services using volumes doesn't have an "extract"  feature.

> So we can conclude that the error **cannot delete Pod with local storage** is more a "confirmation box" to let you know that you have local storage and it should be extracted, if you can, or it will be deleted for good.

---

I hope it will help you! 🍺

---

<center><h3>You want to support me?</h3></center>
<a href="https://www.buymeacoffee.com/mxguilbert7" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
Contribute to the Python-like Nim language
Tags: python, programming, opensource, beginners
Published: 2023-04-03 14:49:37

## Progress

### chores

[fixes changelog](https://github.com/nim-lang/Nim/pull/21590)

[fixes booting warnings](https://github.com/nim-lang/Nim/pull/21583)

### create type bound operations for calls in the method dispatcher for ORC

[fixes #21592; create type bound operations for calls in the method dispatcher for ORC](https://github.com/nim-lang/Nim/pull/21594)

```nim
import std/options

type Event* = object
  code*: string

type App* = ref object of RootObj
  id*: string

method process*(self: App): Option[Event] {.base.} =
  raise Exception.new_exception("not impl")
```

It now works.


### Write an RFC for adding compiler support for object construction shorthand

[compiler support for object construction shorthand](https://github.com/nim-lang/RFCs/issues/517)

### [PR] disable BareExcept warning in panics:on mode

[disable BareExcept warning in panics:on mode](https://github.com/nim-lang/Nim/pull/21605)

```nim
try:
  raise newException(CatchableError, "catched")
except:
  discard
```

With `--panics:on`, the compiler does not give `BareExcept` warnings.

### [PR] warn on overloaded =copy with refc

[fixes #20846; fixes #21427; warn on overloaded =copy with refc](https://github.com/nim-lang/Nim/pull/21606)

### [PR] implement =dup hook eliminating wasMoved and =copy pairs

[implement =dup hook eliminating wasMoved and =copy pairs](https://github.com/nim-lang/Nim/pull/21586)

```nim
proc `=dup`(s: ref): ref =
  dest[] = src
  if src != nil: nimIncRef src
```

The `=dup` hook is for optimization. The compiler sometimes generates `=wasMoved(x); =copy(x, y)`. But `=wasMoved` is unnecessary in this case since it is going to be rewritten for sure. It should be replaced by `x = =dup(y)` instead.

## Weekly collection


https://forum.nim-lang.org/t/9908 (2/19)

https://forum.nim-lang.org/t/9940 (2/26)

https://forum.nim-lang.org/t/9970 (3/5)

https://forum.nim-lang.org/t/9989 (3/12)

https://forum.nim-lang.org/t/10024 (3/19)

https://forum.nim-lang.org/t/10040 (3/26)


## Participating in contributions

Following [The Roadmap 2023 for community building ](https://github.com/nim-lang/RFCs/issues/513), you could join us in [the matrix space](https://matrix.to/#/!ZmWXggMgfkKpcLbQkB:matrix.org?via=matrix.org) where we discuss how to build a community. We appreciate doable suggestions and helps, such as improving the workflow, implementing the roadmap, suggesting doable tasks, reviewing code from contributors. United we stand. We shall work together to make the community thrive.

## Sponsorship

Many thanks to Yepoleb, lenis0012, pietroppeter, Clonkk, mode80, Phil, CxPlanner, shirleyquirk, elcritch, geotre, thinkwelltwd, xrfez, enthus1ast, piertoni, Dnanilem, gemath for [sponsoring me on GitHub](https://github.com/sponsors/planety).
Integrating Audio/Video calls into your application — Twilio, Agora, Zoom, LiveKit
Published: 2023-04-03 14:48:26

https://www.inconceptlabs.com/blog/integrating-audio-video-calls-into-your-application-twilio-agora-zoom-livekit

Before comparing different providers, let’s understand the main requirements and learn some key concepts.

API/SDK availability and integration complexity — first of all, we should understand if there is an SDK for WEB, iOS, and Android platforms and the ease of integration.
UI flexibility is another Key requirement since some providers may give you UI components that are not designed to be customized, and there is no way to embed them into your application UI smoothly.
Recording — audio/video call recording on the server and accessing them via the API. Some providers claim they have a recording, but it seems you need to record it on the client side, and in case the browser is closed or crashed, the recording will be lost.
Pricing is the most critical requirement in this industry since the price calculation could be very surprising for newbies.
It is also important to mention that our goal was to have a deep integration when users interact inside LiveBoard only. Many applications choose the easy path by generating Zoom links and opening Zoom on another tab or placing the Zoom app inside an iFrame, in both cases losing control and user experience.
fpdf2 latest new features
Tags: pdf, python, lib, release
Published: 2023-04-03 14:43:13

`fpdf2` is a simple & fast PDF creation library for Python:

<https://github.com/pyfpdf/fpdf2/> - Doc: <https://pyfpdf.github.io/fpdf2/> [![Pypi latest version](https://img.shields.io/pypi/v/fpdf2.svg?v=2.7.3)](https://pypi.python.org/pypi/fpdf2)

As we just released a new version, [v2.7](https://github.com/PyFPDF/fpdf2/blob/master/CHANGELOG.md),
this is the time to mention some recent additions! 😊

This article will present some of the major features introduced between **v2.5.3** & **v2.7.3** of `fpdf2`:

- Tables
- Images & shapes
- Fonts & text
- Signing & encrypting documents
- Annotations
- Documentation & translated tutorials
- What's coming next?

![Sample table rendered in a PDF document](https://chezsoi.org/lucas/blog/images/2023/04/table-demo.jpg)

Read the full article there: <https://chezsoi.org/lucas/blog/fpdf2-latest-new-features.html>
What are your Goals for the week?
Tags: discuss, motivation
Published: 2023-04-03 14:24:43

What are your goals for this week?
 
- What are you building? 
- What will be a good result by week's end?
- Are you attending any events this week?
- Did you meet your goals last week?

I'll start with how I did last week.

**Last Week's Goals**

- [:white_check_mark:] Continue Job Search.
- [:x:] Blog.

Things I accomplished but did put on goals list.

- [:white_check_mark:]Began portfolio refactor. Based on the template created by @Ram Maheshwari [Ram Maheshwari](https://dev.to/rammcodes/i-created-an-open-source-portfolio-template-for-developers-called-wowfolio-457k). Almost done waiting for some feedback on it.
- [:white_check_mark:]Attended Virtual Coffee's Lightning Talks. Read about that in this [post](https://dev.to/jarvisscript/virtual-coffee-lightning-talks-48km) I just wrote. So I already blogged this week.
- [:white_check_mark:] Restarted TIL Log
- [:white_check_mark:] Updated content to a site I manage.

**This Week's Goals**

- Continue Job Search.
- Blog. Got a few ideas I need to start.
- Short school week for Easter.
- Finish portfolio refactor.



You've read my goals so I'll throw that question back to you.

What are your goals for the week?

```
-$JarvisScript git push
```
understanding Linux systemctl command
Tags: linux, beginners, cloud
Published: 2023-04-03 14:24:12


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fsa307ypp2ntt1pabxus.png)

Systemctl is a command-line utility in Linux systems used for controlling and managing the systemd system and service manager. 

It is an essential tool for system administrators as it provides a simple way to manage the system services, monitor system status, and troubleshoot issues.

The importance of systemctl lies in its ability to manage system services efficiently.

 It can start, stop, restart, enable, and disable system services, allowing users to control the behavior of their Linux system. With systemctl, users can also view their logs to troubleshoot any issues.

If you want to learn how to use the Linux systemctl command, you should check out this post "[How to Use Linux Systemctl Command](https://www.howtouselinux.com/post/how-to-use-linux-systemctl-command)" on howtouselinux.com. 

This post provides a comprehensive guide on how to use the systemctl command with practical examples, making it easy for beginners to follow. The post covers topics such as starting and stopping services, checking service status, managing service units, and more.
Introduction To Automation
Tags: excel, automation, python, 100daysofcode
Published: 2023-04-03 14:14:41

In today's fast-paced digital world, automating tasks is a necessity rather than a luxury. Automation refers to the use of software and tools to complete repetitive, mundane, and time-consuming tasks. It is now a popular solution for businesses and individuals looking to streamline processes, reduce errors, and increase efficiency.
Python, a popular high-level programming language, is widely used for automation due to its ease of use, simplicity, and robustness from data scraping to web testing to server administration. Python provides a vast array of libraries and modules that enable developers to automate a wide range of tasks.


The benefits of automation are numerous and significant. Firstly, automation saves time by reducing manual labor, which frees up resources to focus on other high-value tasks. This increases productivity and efficiency, allowing businesses to deliver more results in less time.

Secondly, automation reduces the risk of errors that are often associated with manual labor. Automated tasks are consistent and precise, resulting in improved accuracy and reliability.

Thirdly, automation reduces costs by eliminating the need for manual labor, which is often expensive and time-consuming. Automation can also reduce the need for additional resources, such as hardware and software, resulting in cost savings for businesses.

Finally, automation can improve the overall quality of work by reducing human error and increasing efficiency. This can lead to better customer satisfaction and increased revenue.

In summary, automation is a powerful tool that can help businesses and individuals achieve their goals faster and more efficiently. With the help of Python, automating tasks has never been easier or more accessible.