teleren/devto huggingface dataset:
Cures for burnouts??
Tags: webdev, productivity, discuss, codenewbie
Published: 2022-09-22 10:15:52

What do you do cure burnouts?

I think I'm currently in a burnout. Plans have been drawn for my project and I've researched what I'll add to it, but I feel like I just crashed. Everything just seems so difficult/annoying. I usually just watch anime for a few days then I'm back on the horse. What's a more positive way to cure burnout?
req.userId is undefined
Tags: react
Published: 2022-09-22 10:05:49


```
import jwt from "jsonwebtoken";

const secret = "test";
const auth = async (req, res, next) => {
  try {
    const token = req.headers.authorization.split(" ")[1];
    const isCustomAuth = token.length < 500;
    let decodedData;
    if (token && isCustomAuth) {
      decodedData = jwt.verify(token, secret);
      req.userId = decodedData?.id;
    }
    console.log("decodedData: " + decodedData);
    next();
  } catch (error) {
    console.log(error);
  }
};

export default auth;
```
How to install Cinnamon on your Steam Deck
Tags: steamdeck, archlinux, tutorial
Published: 2022-09-22 10:05:19

I was really excited when I learned that Valve's Steam Deck has a ["Desktop Mode"](https://help.steampowered.com/en/faqs/view/671A-4453-E8D2-323C). This means that I can easily dock it and use it as it's a fully fledged desktop computer wherever I go.

By default, it's running Arch Linux and KDE Plasma. As I'm not super used to KDE, I decided to try installing Cinnamon desktop instead. The process wasn't as straightforward at time of writing so I'm sharing what I went through, in case it's useful for others.

## Step 1: disable read-only and install dependencies

```
sudo steamos-readonly disable
sudo pacman-key --populate archlinux
sudo pacman -Sy archlinux-keyring
sudo pacman -Syu
sudo pacman -S base-devel linux-api-headers glibc binutils gcc git libarchive
```

## Step 2: install Yay (optional)

Some Cinnamon packages require [Yay](https://github.com/Jguer/yay). This step is optional, but Yay will probably be useful down the line.

```
cd /opt
sudo git clone https://aur.archlinux.org/yay.git
sudo sudo chown -R deck:deck ./yay
cd yay
makepkg -si
```

## Step 3: install Cinnamon

```
sudo pacman -S cinnamon gnome-terminal
```

## Step 4: replace Plasma with Cinnamon

Steam Deck has a series of scripts that allow for switching between "Desktop Mode" and "Gaming Mode". As to not disrupt these flows, I'm just replacing the binary being launched from Plasma to Cinnamon's in `/usr/bin/startplasma-steamos-oneshot`.

```
sudo cp /usr/bin/startplasma-steamos-oneshot /usr/bin/startplasma-steamos-oneshot.old
sudo sed -i 's#CHAINED_SESSION="/usr/bin/startplasma-x11"#CHAINED_SESSION="/usr/bin/cinnamon-session-cinnamon"#' /usr/bin/startplasma-steamos-oneshot
```

## Step 5: replace desktop shortcut

Steam Deck has a useful "Return to Gaming Mode" shortcut on the desktop that can be used to quickly switch back from Desktop Mode. This is merely a quick way to log off, but Cinnamon uses a different mechanism to achieve it, so we can patch that up too.

```
cp ~/Desktop/Return.desktop ~/Desktop/Return.desktop.old
sed -i -E 's/^Exec=.*/Exec=cinnamon-session-quit --logout --no-prompt/' ~/Desktop/Return.desktop
```

## Step 6: remove KDE Plasma (optional)

After installing Cinnamon and verifying it works, I decided to remove most of Plasma to free up some space. Make sure you reboot and verify everything works fine before this step!

```
pacman -R plasma-browser-integration plasma-desktop plasma-disks plasma-firewall plasma-integration plasma-nm plasma-pa plasma-systemmonitor plasma-thunderbolt plasma-vault plasma-workspace plasma-workspace-wallpapers plasma-wayland-session powerdevil systemsettings plasma-meta kdeplasma-addons kgamma5 khotkeys kinfocenter sddm-kcm dolphin kwrite oxygen milou kwrited kwayland-server kwin kwayland-server kwallet-pam kwayland-integration ksystemstats  ksshaskpass kscreenlocker kscreen kmenuedit kmenuedit kde-gtk-config kde-cli-tools kactivitymanagerd kuserfeedback krunner kdesu  discover breeze breeze-icons kdecoration
```
Unseen Gender Discrimination in the Workplace & it's effects [WIP]
Tags: womenintech, career, leadership, culture
Published: 2022-09-22 10:03:06

Up until recently, I didn’t have much to say about the need for diversity pushes in the workplace, I understood their value and intent and could explain those initiatives to the male colleagues that asked, and yes, I’ve had some encounters with backwards people and bosses. 

It may also have helped that I was the eldest of 3 girls, went to an all-girls school, and was never told I was less than anyone. In fact, I was consistently told I could do anything I put my mind to by my father, who was a man that believed in education for girls and was ahead of his time, quite frankly. Another factor being that I ran my own business in my twenties and had plenty of life experience before I entered the world of tech and big corp's.

Until recently. When I realised in the most awful way, the myriad of interconnected biases and treatments that can create a “death by 1000 cuts” scenario for underrepresented folks in the workplace. These stories are much harder to quantify. They are not as overt, they don’t evoke the same amount of outcry and they leave individuals feeling powerless to even bring the topic up.

While men can be our best allies in the quest for workplace equality (and believe me I have had some amazing male mentors - shout out to you guys - you know who you are), they can also be the absolute worst offenders and gate-keepers to the male privilege of having it all.

There’s a few things I want to make clear first, I am a person that will (barring a bad day) give everyone the benefit of best intentions. If someone is shocked I’m technical because I’m a woman, ok, it’s annoying that I have to play the role, but I will educate them that there are many smart and beautiful women doing amazing things in modern society. And they are not “women coders” or “women scientists” - they are just experts in their (non-gendered) field. When I see women’s groups who are just leveraging the movement for their own advantage or virtue signalling to get ahead, I am also absolutely furious. These women set things back 100 years.

Basically, if you wanted a balanced, non-confrontational view on the issues, I was the person you might ask. Several times I was that person. Once on whether all-women hackathons should exists (shout out to the male that was curious enough to ask and felt safe enough to do so) - and the answer is yes, they should. Why? Because traditional underlying social roles crop up otherwise. A woman might be a great project lead, but she may also unconsciously just let a man on the team do it, for example.

The problem isn’t with the broad strokes of things. The big issue lies in biases.

These problems are much more insidious
PHP Token ICO Presale Launchpad Script - Multi Chain
Tags: ico, presale, token, script
Published: 2022-09-22 09:59:47

## PHP Token ICO Presale Launchpad Script - Multi Chain

### FULLY AUTOMATIC DELIVERY

### WORKS INTEGRATED WITH METAMASK

#### (English, German, French, Russian, Arabic, Chinese, Turkish)

---

### **[BEP20 - ERC20 Token Generator Script](https://dev.to/webtroloji/erc20-and-bep20-token-generator-script-auto-gain-and-multi-chain-4h73)**

---

If You Have An ICO - Pre-Sale Planning For Your New Token Project, We Have Prepared This Planning For You To Realize It In The Healthiest Way.

You Can Pre-Sell Your Token on 7 Blockchain Networks.

---

## **[CLICK FOR DEMO.](https://ico.tokenator.app/)**

---

You can determine the price of each token amount to be sold in the pre-sale from the panel yourself.
Pre-Sale Details;


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

You Can Set and Limit the Minimum and Maximum Quantity that can be purchased from the Pre-Sale.
You Can Also Use The One Time Pre-Sale Feature Of Each IP On All Networks.
When the User Makes the Payment;


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

At this stage, after passing the security checks, the Deserved Token Amount is Automatically Sent to the User's Wallet.
When the Transfer Process is Successfully Completed, the "Transaction Details" Page is displayed to the user, and All the Details and Links of the Transactions are found.


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

In addition, there is an auxiliary button "Add to MetaMask" so that the user can see the supply of the token.
If the User Uses This Button, Token Information is Added to the MetaMask Wallet and Also Listed on MetaMask with the Token Logo Image You Set in the Admin Panel.


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

All Operations on the User's Side End Here.
Management panel;
The Page where the Logs are Recorded, Where You Can Control All Transactions.
It Records All Actions Taken and Displays Successful or Error Results.


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

Page where you can see and edit all BlockChain Networks;


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

The software is Clean Coded with PHP 7.4 and CodeIgniter4.
Powered by NodeJS.
There must be NODEJS in the server or hosting of the software to be installed.

---

## **[CLICK FOR DEMO.](https://ico.tokenator.app/)**

---

You can contact via Telegram for Purchase, Question, Suggestion.

## **[TELEGRAM](https://t.me/webtrolojiwork)**

---

### **[BEP20 - ERC20 Token Generator Script](https://dev.to/webtroloji/erc20-and-bep20-token-generator-script-auto-gain-and-multi-chain-4h73)**
Integrate Google Recaptcha Enterprise using Vue.js and Golang
Tags: vue, go, googlecloud
Published: 2022-09-22 09:48:33


Do you know how to [integrate](https://medium.com/canopas/integrate-version-catalog-in-android-2f26d6fff3ea) Google Recaptcha enterprise into your website or [web app](https://blog.canopas.com/why-and-when-do-you-need-feature-flags-with-examples-dd7c609e5413)?

Google Recaptcha uses advanced risk analysis engines and automated public turing tests to protect our [application](https://blog.canopas.com/add-flutter-view-to-native-android-application-3747edb83e62) from spam or abusive activities by bots. It can be able to identify bots and humans and let valid users use our application.

**Here is a step-by-step guide on implementing it in Vue and Go. For ease of reading, this post is divided into 4 parts.
**
1. Configure reCaptcha on the Google cloud console
2. Add a javascript API reference on the website(VueJs)
3. Initialize reCaptcha and generate the token
4. Verify reCaptcha token at backend(Golang)

To read the full version of this article, navigate to the [canopas blog](https://blog.canopas.com/integrate-google-recaptcha-enterprise-using-vue-js-and-golang-60a9335e80ac).
Tiny Tips : gitk -- (with 2 dash)
Tags: git, productivity
Published: 2022-09-22 09:42:42

When I want to view the history of a file, I use `gitk`, start typing a few letters, hit `tab`, type again, hit `tab`, etc… to autocomplete the full path:

```
gitk src/com<tab>ponent/data<tab>base/dba<tab>ccess.py
```

However, when hitting `tab`, `gitk` may hang a few seconds, especially on huge repositories. It's because he tries to autocomplete a branch name in addition to local files.

By adding `--`:

```
gitk -- srs/com<tab>...
```

Autocompletion will only complete local files, making it much more reactive.

**Note:**
In this case, `--` is not a `gitk` feature, but a [shell feature](https://www.baeldung.com/linux/double-dash-in-shell-commands).
Remove Element
Published: 2022-09-22 09:29:37

```
class Solution:
    def removeElement(self, nums: List[int], val: int) -> int:
        while val in nums:
            nums.remove(val)
```
Day 2 of 10. Leet code problem can be found [here](https://leetcode.com/problems/remove-element/)

I looped through the entire array while checking if the val is in the array. if it is found, i remove that particular value.

tada :)
CloudWildBoar and 100% Availability
Tags: cloud, aws, architecture, beginners
Published: 2022-09-22 09:28:31

> No system provides 100% availability, so the pragmatic question is whether or not CloudWildBoar delivers availability that is so high that most users don't worry about its outages. For example, given there are many sources of outages for an application, if CloudWildBoar is an insignificant contributor to its downtime, then users are correct to not worry about it.

**CloudWildBoar** does not exist. It is not a service on AWS (yet?) or any other cloud provider. I made it up.

The sentence is not mine, it originally referred to Google Spanner and it is from an old article “[Inside Cloud Spanner and the CAP Theorem](https://cloud.google.com/blog/products/databases/inside-cloud-spanner-and-the-cap-theorem)”.

But I always keep the sentence handy for any meetup, conference, tech discussion when someone asks or brags about availability, number of nines of a specific provider, database, service or feature.

AWS or any cloud provider and their specific services might have occasional failures and you should be aware of those. And there are limited scenarios where it really matters. But usually **the weakest links are your own application and deployment**. 

Fix those, sit down and relax. And keep that sentence ready for your next chat.

Photo by [Austin Neill](https://unsplash.com/@arstyy?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on Unsplash.
How to find the number of Books updated by the program in Rails
Tags: rails, programming
Published: 2022-09-22 09:28:18

Let's say I have a script running and I want to find the last updated isbn number of the book during the run time with rails console.

```ruby
Book.where(updated_at:Book.maximum('updated_at')).first.isbn
```

Then I can find how many books are updated during the runtime with this enhanced query

```ruby
Book.pluck('isbn').uniq.find_index(Book.where(updated_at:Book.maximum('updated_at')).first.isbn)+1
```

Neat! Isn't it ?
Abort an Axios request with a simple library
Tags: react, javascript, node, axios
Published: 2022-09-22 09:22:02

## TL;DR

Starting from v0.22.0 Axios supports AbortController to cancel requests. But it requires lots of steps to handle AbortController in every Axios request.

So, I just write a simple library [`axios-abort`](https://github.com/lnquy065/axios-abort) to implement it with no code changes. 

## Installation

`npm install axios-abort --save`

Notice: Make sure you are using Axios v0.22.0 or higher

## Usage

### Small configuration

In your axios configuration file:

For global configuration:
```javascript
import axios from "axios";
import withAbort from "axios-abort";

withAbort(axios);
```
For instance configuration:

```javascript
import axios from "axios";
import withAbort from "axios-abort";

const axiosAbort = axios.create()
withAbort(axiosAbort);
```

Now, all axios request promises will contain `abort()` function. You can use it to abort a request.

#### Node.js
```javascript
let promise = axios.get("https://google.com")

promise.then().catch(error => {
        console.error(error) // => error due to abort
    })

promise.abort()
```

#### React hook
```javascript
useEffect(() => {
    let promise = axios.get("https://google.com")

    promise.then().catch(error => {
        console.error(error) // => error due to abort
    })

    return () => {
        promise.abort()
    };
}, []);

```

## Supported Methods

`axios-abort` supports methods below:

```javascript
axios.get(url[, config])
axios.delete(url[, config])
axios.head(url[, config])
axios.options(url[, config])
axios.post(url[, data[, config]])
axios.put(url[, data[, config]])
axios.patch(url[, data[, config]])
```

You also can customize supported methods list via `options` parameter:

```javascript
withAbort(axios, {
    methods: ['get']    // only add abort controller into GET method
})
```

Thanks for reading and hope you like it 🙆
Pair programming in PHPStorm
Tags: pairprogramming, phpstorm, sharingiscaring
Published: 2022-09-22 09:15:30

## What is pair programming

According to [wikipedia](https://en.wikipedia.org/wiki/Pair_programming): Pair programming is an agile software development technique in which two programmers work together at one workstation.

Best said: you and your colleague program together at the same time. Wether you sit next to each other or do this online, the idea is you switch roles now and then so you both programmed a part of the code. One is coding and the other will help you while you write your code and both players think out loud.

Like drivers in a rally car:

<img width="100%" style="width:100%" src="https://media.giphy.com/media/cekCJqDUpzrm86n7Kf/giphy.gif">

## Why would you pair program
For many reasons:
- Problems are better solved, code quality increases
- Your code is being reviewed on the go
- Better ideas by talking through your ideas and solutions
- Learning from each other when having different approaches

## How to pair program in PHPStorm
Of course you can share your screen and pair program, but I prefer doing so via PHPStorm and this is how to:

1. Start a session

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

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

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

4. Send url for invitation

CongratS! You are officially pair programming now

<img width="100%" style="width:100%" src="https://media.giphy.com/media/QyKwWQzeOSl9e/giphy.gif">

## Bonus: follow your colleague
When a sessions is running, you can easily follow each other by clicking on the name of your colleague. It should color your window and say something like "Following colleague..."


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


Checkout the documentation for more info and how to setup your session from the start (https://www.jetbrains.com/help/idea/code-with-me.html#start-guest)[https://www.jetbrains.com/help/idea/code-with-me.html#start-guest]
Getting the first dev job… What now ?
Tags: discuss, career, codenewbie
Published: 2022-09-22 09:13:21

## I got my first job as a junior front end developer

My happiness is beyond imagination 😀

 I started to learn we development a few years back totally as a hobby. It was end of 2021, when I decided to make it as a career.

I went to a bootcamp to learn about full stack development. It has 3 modules (front end, JavaScript and back end module). This bootcamp is not the typical super intensive course, it is just 5 hours per week and the rest is self study (if you want, that depends on you). 

So after the front end module, I decided that I want to take this serious. I quit my lab technician job and became a “student” full time. During the JavaScript module I started to feel confident and applied for jobs. You know just casually. Just to see how an interview looks like even . Pssst it is totally different from the environmental industry interviews. 

Aaandd here I am. After two module finished and 9 month later I am starting my first junior JavaScript front end developer job in October fully remote position 🚀🍾

So I would love to hear any advice (do’s and don’t) or your story about your first job! 😊
Modify node_modules directly? You are not very elegant!
Tags: npm
Published: 2022-09-22 09:11:17

## Why do we need to modify the files in the node_modules?
In daily development, it is rarely necessary to change the code in node_modules, but there are many situations that need to be modified.

For example, a scene I encountered last time. I used a middleware package for interface forwarding, but I encountered a problem. This package limits the format of uploaded files.

In fact, I want to let go of the restrictions on file formats and support all file formats, so I am forced to modify the code of this package in node_modules and let go of its restrictions, so as to achieve the effect I want.

So how do I change it?  This is a problem. Or, how should I change it to be the best? 

## 1.  Modify directly
This is easy to understand, that is, go directly into node_modules, find the code of that package, modify the code in the corresponding place, and then restart the project. I can achieve the effect I want.

But in fact,  this approach has too many disadvantages!
- It can be used only in your local environment, your colleagues can't use it.
- The code of that package will be restored to its original state after executing npm i command.

So no one should do it.

## 2.  Maintain a package independently
I used a package named A, which restricts the format of the uploaded file, but I don't want it, I want to let go of the restrictions, so what can I do?

I can do it like this. I write a new package B, which is actually a copy of package A, and after finishing the copy, I let go of the restrictions of package B, and then publish package B to  the npm platform. 

I don't need to use package A in my project anymore at this time, I just need to install package B I maintain. Although this can also achieve that effect, it will increase the maintenance cost.

## 3.  patch-package
This is a tool specially used to modify the code of the packages in node_modules, and it is also very simple to use.

### 3.1 Install patch-package
```
npm i patch-package
```

### 3.2 Modify node_modules
For example, If I want to modify package A,  then I modify it directly in node_modules, and I execute this command:
npx patch-package A

At  this time,  the directory patches will appear in the root directory of your project, and a patch file for package A will appear in it. This file can be very useful.

Remember to submit the patches directory to Git.

In fact, at this time, you have already used the code modified by yourself, but the question is how to make your colleagues synchronize with the code.

3.3 "postinstall": "patch-package"

Add command in the script of package.json file
```
"postinstall": "patch-package"
```
The function of this command is: when your colleague executes npm i, the command npm run postinstall will be executed automatically, which means that it will read the patches directory and put those patches into the corresponding package.
Cherrybomb for OWASP Conference 😁 🥳
Tags: opensource, api, security, rust
Published: 2022-09-22 09:09:49

## API Security Testing into your CI Pipeline

Right now, your web app is most likely vulnerable to an attack.
According to a recent survey, 9 out of 10 web applications were vulnerable to attack in recent years, with 45% of production apps exhibiting "high risk" vulnerabilities.
That is a significant number.
[CherryBomb](https://github.com/blst-security/cherrybomb) can help you run automatic security checks right in your CI/CD pipeline, which is outstanding.



## OWASP-CherryBomb

We are glad to announce that we will present CherryBomb at an [OWASP](https://owasp.org) conference.
The Open Web Application Security Project (OWASP) is a nonprofit foundation that works to improve the security of software.
This OWASP Conference is open to the entire community, and if you're keen on being ahead of the curve, let's have a chat! But you should surely attend.

It will be shown how the OpenAPI spec and Cherrybomb can be used in the real world.


## Points we are going to talk about

- OpenAPI specifications concepts and how important and simple they are to generate

- API security testing in the CI pipeline, as well as a demonstration of Cherrybomb's functionality.

- Demo Time 😋 We'll use [Cherrybomb](https://github.com/blst-security/cherrybomb) to find a set of vulnerabilities on a live API. 

Link for the conference: [https://www.meetup.com/owasp-msp-meetup/events/288608767/](https://www.meetup.com/owasp-msp-meetup/events/288608767/)
Test your API for free now at [BLST](https://www.blstsecurity.com/?promo=nasi&domain=https://dev.to/The_Benefits_of_Taking_Breaks_Why_Pausing_Can_Help_You_Be_More_Productive)!