teleren/devto huggingface dataset:
Reduce your Jest tests running time (especially on hooks!) with the maxWorkers option
Tags: webdev, testing, jest, beginners
Published: 2022-12-08 15:52:29

Photo by <a href="https://unsplash.com/@josholalde?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Josh Olalde</a> on <a href="https://unsplash.com/s/photos/workers?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

Many applications have hundreds (and sometimes thousands!) of tests. Sometimes those tests are run only manually; more often they're attached to some hook. For example, we can use 'husky' to run some action before the commit or the push. In my case, lint and prettier before the commit and tests before the push.
Or the tests can be run during some actions on a CI/CD tool.

I'm with a MacBook Pro 2020, and I've got around 170 unit and integration tests running on a frontend application. That means that at least half of it needs rendering the components many times - hence consuming much memory and CPU.

When I run my tests manually, they usually are pretty fast, around 1 minute and some seconds of execution time.
However, I found that when I'm pushing the code to our repository, many times the test suites fail on timeout. They exceed the default time limit of 5 seconds.

Of course, this limit can be increased. But if 5 seconds is not enough for running a test, there's something wrong!

Now, although Jest runs with Javascript (which is single-threaded), it uses workers to divide the workload among many Jest processes, imitating multi-threading.
Jest calculates -on many factors- how many workers can activate and runs them. In my case, there were around 8. When I was running them continuously, my laptop fan started running as if it was going to melt.

CPU got slower with the heating up and tests were starting to timeout because there was no more computational power to let them run properly.

Luckily, Jest let us customize this option with --maxWorkers.
On my CRA (Create React App) I added this option cutting in half the workers to the test command:
```
"test": "react-scripts test --maxWorkers=50%"
```

This lets just 4 workers be spun and let the tests pass without timeout issues. Their execution was anyway fairly quick, and it prevented me from any more trouble! 
Of course, the option can be set even lower (or higher). It depends on many factors, so you can try and test yourself (pun intended)!

Thank you for reading! Let's connect on [Twitter](https://twitter.com/AlexBuaiscia) or [Mastodon](@alex_@uiuxdev.social)!
Creating A Carousel In React With Bootstrap
Tags: webdev, javascript, react, beginners
Published: 2022-12-09 07:12:38

Creating a carousel in react might sound a bit intimidating; but with the right tools and background knowledge, it becomes much easier. First, we'll start by installing Bootstrap with npm.

`npm install react-bootstrap bootstrap`

After you have installed Bootstrap, you will need to import it into your JS.

`import Carousel from 'react-bootstrap/Carousel';`

Now let's get to the fun part. You'll want do use the following code to create your carousel:

```
 <Carousel>
  <div className='slide'><img src='https://cdn.mos.cms.futurecdn.net/MeU4HokrzUwhbd9PJBQCSV-1200-80.png'/></div>
  <div className='slide'><img src='https://fs-prod-cdn.nintendo-europe.com/media/images/10_share_images/games_15/nintendo_switch_download_software_1/2x1_NSwitchDS_Overwatch2WatchpointPack_image1600w.jpg'/></div>
  <div className='slide'><img src='https://i.ytimg.com/vi/wQATS4HOxdo/maxresdefault.jpg'/></div>
  <div className='slide'><img src='https://p325k7wa.twic.pics/high/elden-ring/elden-ring/04-retailers/00-beautyshots/04-Standard/ER_standard_keyart.jpg?twic=v1/step=10/quality=80/max=760'/></div>
  <div className='slide'><img src='https://cdn.cloudflare.steamstatic.com/steam/apps/570940/capsule_616x353.jpg?t=1668145065'/></div>
  <div className='slide'><img src='https://images2.alphacoders.com/204/thumb-1920-204972.jpg'/></div>
  <div className='slide'><img src='https://i.ytimg.com/vi/H4rYVsJ4v9Y/maxresdefault.jpg'/></div>
  <div className='slide'><img src='https://cdn.akamai.steamstatic.com/steam/apps/12210/capsule_616x353.jpg?t=1618853493'/></div>
</Carousel>;
```
Personally, I recommend putting the carousel in its own component in case you need to use it in different places throughout your app. Putting it in its own component will also make it significantly easier to see what the placement will look like in your app.

After that, you're pretty much done. This will give you the basic foundation for your carousel. It can be customized to your liking by changing fonts, speeds, styles, transitions, and image size. I recommend playing around with these to see what you prefer and what works best with your personal style and project. You can use this for a slide show or even a loading page if you wanted to. Happy coding!
MIG/MAG wires
Published: 2022-12-09 09:04:22

**[MIG/MAG welding wire](https://royalweldingwires.com/mig-mag-welding-mild-steel-wires/#70S3)** is used in welding. There is a difference between MIG and MAG: MIG stands for 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h3nr8xk0rnwnridd7fji.jpg) metal inert gas (ARGON, HELIUM), and MAG stands for metal active gas (CO2).

MIG/MAG wires are most commonly employed to weld thin pieces of metal together. They are used to fill gaps between two pieces of metal by depositing filler wire into them.

To join metal pieces, welders work with MIG/MAG. As the pieces are clamped together, the wire is inserted into the gun of a welding machine. This should be followed by a constant feed and trigger action. This will maintain a consistent weld line along the joint.

The welder has control over how much heat is applied to each area by using a regulator available in the welding machine.
Two Peas In A Pod - What Makes Isabella And Aiden's Friendship So Beautiful?
Tags: friendship, relationship, isabella, love
Published: 2022-12-09 12:50:24


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

They say all good things come in pairs. After all, why chuckle alone when you can laugh uncontrollably with someone? Why cry alone when you can wipe your tears using your best friend's shirt? Why go through this journey alone when you can pair with your pea in this pod we call life?
Author Xayley Rose, in her upcoming novel, [My Other Half](https://www.amazon.com/My-Other-Half-Xayley-Rose-ebook/dp/B0BM57B4V8/ref=sr_1_8?crid=2V7M2D08UGL1K&keywords=My+Other+Half&qid=1669397326&s=books&sprefix=%2Cstripbooks%2C742&sr=1-8), introduces her fans to Aiden and Isabella, the embodiment of the phrase, "two peas in a pod." Let's read through the beautiful resonances she breathed in her characters, giving their relationship life.

## The test of time

We all experience friendships, some long-term, some existing until the going gets really tough. No matter how many laughs you might share with your friend, the question is, will your friendship stand the test of time?
Aiden's blue eyes wrapped around Isabella from the first day of school until high school like a warm blanket of comfort. Their duo was a nod that, yes, such relationships exist.

## Little gestures of love

Actions speak louder than words. If you're in a healthy friendship, efforts must be reciprocated for both parties to be happy and feel loved. Being excited for your friend's birthday more than they are, coming over to surprise them when they're down, and holding them tight when all hope seems lost to them are just a few phrases in the love language of friendship. 
Aiden and Isabella are two friends who encapsulate this love language and translate it perfectly despite their banter. Xayley Rose treats us with numerous moments shared by Aiden and Isabella to make us gush.  

## Getting used to you

We all think we are good liars; why would anyone lie if they knew they'd be caught? But as closed a book you might deem yourself out to be, it is a different story when it comes to your best friend. If your friend knows you, a slight twitch of the brow or tweak in voice is caught. 
A true friend is one who hears you say so much, even in the silence. Aiden reads Isabella like a book that doesn't know it's being read. Their friendship shows the beauty in knowing someone so profoundly that their every action is familiar. 

## Dear best friend

You are lucky if you have found your pea in this pod, just like Isabella and Aiden found each other. So the next time you see them, hug them tightly and thank them for being there. Thank them for their silly jokes that make your day better, the untidy card they made for you on your birthday, but most importantly, thank them for being them and existing in your life. 
Spoke to your heart? Share Isabella and Aiden's relationship with your best friend by getting them a copy of My Other Half as a nod to how you find similarities between them and the two of you. Click on the link to learn more.
Open Source Dashboard (for js developers)
Published: 2022-12-09 14:08:52

---
title: Open Source Dashboard (for js developers)
published: true
date: 2019-06-15 16:00:02 UTC
tags: 
canonical_url: https://blog.niradler.com/open-source-dashboard-for-js-developers
---

Javascript open-source maintainers often have a hard time tracking their npm package status.

> I used until recently npm-stats.com to get npm information about my packages, recently the site stops to work, so as a coder it was an easy decision to start working on a clone.

The package I created is called npmdash. (short for npm dashboard)

![Open Source Dashboard (for js developers)](https://cdn.hashnode.com/res/hashnode/image/upload/v1642373588890/GV9w3XVCL.png)

The homepage is a very simple input field to enter the npm username. (be patient it can take a while.)

![Open Source Dashboard (for js developers)](https://cdn.hashnode.com/res/hashnode/image/upload/v1642373591036/qeCe_nRex.png)

This is the packages view it's a list of the packages sorted by monthly downloads, including data on the package that can help you get more insight into the package, in the future more relevant data will be added.

You can use the [hosted](http://npm.devresources.site/) version, the docker version or the open-source CLI option.

The hosted version uses AWS fargate, you can clone the repo and build your docker version if needed, and deploy it to your own container solution.

CLI Usage

```
npm i -g npmdash
npmdash // will open the homepage
npmdash -u <username> // will open the packafes view for this username

```

Docker Usage

```
docker pull niradler/npmdash
docker container run -p 8989:8989 npmdash

```

For future improvements, I will like to improve the GitHub integration, improve the UI and get reports maybe? Still thinking about it.

Enjoy and let me know what you think :)
Generate JWT secret key using OpenSSL
Published: 2022-12-09 15:00:50

Searching online for a way to generate an HS512 JWT secret key, I found a [Stack Overflow post](https://stackoverflow.com/a/56934114/177416) with the OpenSSL command:

```
openssl rand -base64 172 | tr -d '\n'
```

Then the question was: do I have OpenSSL installed on my PC? If we have Git installed, [it includes OpenSSL](https://stackoverflow.com/a/51757939/177416) at this location:

```
C:\Program Files\Git\usr\bin\openssl.exe
```

Running the command at that location generates the key.
AdventJS 2022 - Retos de código para Javascript cada día de diciembre
Tags: javascript, typescript, adventjs, adventofcode
Published: 2022-12-09 23:22:51

Recientemente me he enterado de una iniciativa que salió a la luz por vez primera el año pasado y en este continúa con su segunda edición.

Se trata de [adventJS](https://adventjs.dev/) un espacio creado por [@midudev](https://midu.dev/) en donde tendrás la oportunidad de poner en práctica tus conocimientos de programción intentando resolver 1 reto por día hasta navidad.

Los retos podrás resolverlos en **Javascript** o **TypeScript** según prefieras. Existe una tabla de puntuación y los puntos serán asignados según la calidad del código.

La edición anterior de este proyecto aún está disponible en el siguiente enlace: [adventJS 2021](https://2021.adventjs.dev/).

La plataforma cuenta con su propia consola para codificar y probar tus resultados, por lo que no necesitarás instalar nada adicional en tu equipo.

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

Si llegas un poco tarde como yo, no te preocupes, aún puedes ponerte al día.

Para mayor información acá tienes [la nota oficial](https://midu.dev/adventjs-2022/) y su tweet de lanzamiento:

{% embed https://twitter.com/midudev/status/1597965996383412225?s=20&t=U5XwNIZYwC0wtSzGiiKw1g %}

---

Aunque JS no es mi fuerte, **lo intentaré**, así que espero que tú también. A medida que vaya avanzando publicaré las soluciones por acá para que sirvan de comparación y retroalimentación.
A bit of blabbering about website startup’s.
Tags: beginners, career, writing, startup
Published: 2022-12-10 08:03:21

I’ll be honest…

It's really hard trying get audience for new startups in this age & day if you're new to this.

I mean, can you REALLY do seo and backlinking stuff from get go of by just reading few articles?

This was, until my friend told me about creating guest post on already popular website or advertising on marketplace but it's really costly & hard to do for a new product owner.

Than i thought i need to do something to change this…

So i started working on a project called simileto which provides people a place to list their startups for getting people to familiarise with new products and get mentioned in their competitors product page.

It's listing site for app, website, game, marketplace, alternative and [software suggestion website](https://www.simileto.com/) made for people to get acquainted with old and new products replacements when they shutdown or are just starting up.
ChatGPT, the last nail on the coffin for coding interviews?
Tags: chatgpt, programming, webdev, discuss
Published: 2022-12-11 18:39:32

You know how you rely on Google to solve all of your life's problems? No? So it's just me then?
 
Programmers ,I'm certain, can relate when it comes to solving their coding problems. Now imagine if Google were on steroids. That's how some are describing [ChatGPT](https://en.m.wikipedia.org/wiki/ChatGPT).

![An image implying that ChatGPT is here to replace Google](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9irw41d1nxbtozgljy2l.jpg)
The AI is here to disrupt and it's thrilling to see how the tech industry will take to it specifically with regards to coding interviews. 

![An image showing human beings working together with AI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7j2awvzqo3axo8wycaq7.jpg)
Some companies might opt to ditch coding interviews entirely and stick to holding technical discussions with candidates. Some might just tighten the monitoring process of the interviews.

Programming interviews might now be more focused on understanding problem solving capabilities, thought processes and assessing familiarity with tools (such as [ChatGPT](https://en.m.wikipedia.org/wiki/ChatGPT)). 

Looking at the glass as half full, ChatGPT will open the door for new and interesting ways of solving problems including for hiring good people.

![An image showcasing how AI will help humanity to solve problems](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0tuvpk6ytnve66tm5kx2.jpg)
Software engineers you can relax, your jobs will be safe , probably.
The Programming Language You Learn Doesn’t Matter That Much
Tags: programminglanguages, programming, coding, javascript
Published: 2023-01-06 12:01:27

---
title: The Programming Language You Learn Doesn’t Matter That Much
published: true
date: 2023-01-06 07:16:50 UTC
tags: programminglanguages,programming,coding,javascript
canonical_url: https://javascript.plainenglish.io/the-programming-language-you-learn-doesnt-matter-that-much-f5f5c8ed71d0
---

[![](https://cdn-images-1.medium.com/max/2600/1*YATZQO1ojT9s728i6TIrHA.jpeg)](https://javascript.plainenglish.io/the-programming-language-you-learn-doesnt-matter-that-much-f5f5c8ed71d0?source=rss-b970c961c4e1------2)

It’s the side work you do that matters

[Continue reading on JavaScript in Plain English »](https://javascript.plainenglish.io/the-programming-language-you-learn-doesnt-matter-that-much-f5f5c8ed71d0?source=rss-b970c961c4e1------2)
Explain like I'm 5
Tags: webdev, flutter, programming, beginners
Published: 2023-01-07 00:02:10

I asked chatGPT to explain the Flutter Architecture to me as if I were 5 years old.

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


_Considering how creative its explanation was, chatGPT will continue to be a sharp tool in the kit of those with great ambition for change._

Thanks for stopping by
বুটস্ট্রাপ কার্ড কম্পোনেন্ট এর ক্লাসগুলোর সহজ, সিম্পল বিশ্লেষণ
Tags: bootstrap, css
Published: 2023-01-07 13:18:33

Bootstrap তাদের card component এর code এ কোন কোন class কেন ব্যবহার করেছে সেটা আমরা আজকে এখানে কিছুটা আলোচনা করার চেষ্টা করব। 

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

```
<div class="card" style="width: 18rem;">
  <img src="..." class="card-img-top" alt="...">
  <div class="card-body">
    <h5 class="card-title">Card title</h5>
    <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
    <a href="#" class="btn btn-primary">Go somewhere</a>
  </div>
</div>
```


**.card ->** Bootstrap এ card তৈরি করার জন্য একটা in-built component. এই class এর under এ যা লিখা হবে bootstrap সেতাকে একটা card এর মত design করার চেষ্টা করবে। 

**.card-img-top ->** এর মানে হল card এর মধ্যে image টা vertically (column wise) সবার উপরে থাকবে।  যদি আপনি image টা সবার নিচে দেখাতে চান, সেক্ষেত্রে .card-img-bottom এই class টা ব্যবহার করতে হবে। .card-img-top এটা ব্যবহার করলে image এর top দুইটা corner rounded হবে, bottom corder দুইটা sharp হবে। উপরের image এর মত। আর .card-img-bottom এটা ব্যবহার করলে top corder দুইটা sharp হবে, নিচের corner দুইটা হবে rounded।

**.card-body ->** image ছাড়া আর বাকি যত content আপনি card এর মধ্যে দিতে চান সব গুলোকে bootstrap card এর body হিসেবে বিবেচনা করেছে এবং সেই হিসেবেই design করেছে। তাই এই class টি ব্যবহার করা হয়। 

**.card-title ->** card body content এর title এর styling দেওয়ার জন্য এই class ব্যবহার করা হয়েছে।

**.card-text ->** card body content এর text এর styling দেওয়ার জন্য এই class ব্যবহার করা হয়েছে। Normally এটা দেখে আপনার কাছে মনে হতে পারে এটা p এর কাজই করছে। আসলেও করছে অনেকটা তাইই। তবে এই ক্লাস এর under এ bootstrap নিজের মত করে কিছু assignment, spacing সেট করে দিয়েছে। 

**~let's_code_your_career
~happy_coding**
Weekly Challenge 198
Tags: perl, python, theweeklychallenge
Published: 2023-01-08 06:13:59

Two relatively straight forward tasks to start the new year.

[Challenge](https://theweeklychallenge.org/blog/perl-weekly-challenge-198/), [My solutions](https://github.com/manwar/perlweeklychallenge-club/tree/master/challenge-198/sgreen)

## Task 1: Max Gap

### Task

You are given a list of integers, `@list`.

Write a script to find the total pairs in the sorted list where 2 consecutive elements has the max gap. If the list contains less then 2 elements then return 0.

### My solution

For this task, I have defined two variables. The value `gap` records the largest gap between two numbers so far, while the `count` value records the number of occurrences of the gap.

The first thing I do is (numerically) sort the list. I then iterate from 0 to the size of the list minus two. For each iteration, I compare the difference in the value in that position to the one in the next position. If the gap is greater, I set `gap` to the difference, and reset `count` to 1. If the difference is the same as the current gap, I increase 1 to `count`.

Finally I display the value of `count`.

### Examples

```bash
$ ./ch-1.py 2 5 8 1
2

$ ./ch-1.py 3
0
```

## Task 2: Prime Count

### Task

You are given an integer `$n > 0`.

Write a script to print the count of primes less than `$n`.

### My solution

Time to pull out my trusty `is_prime` method. This was last used in task 2 from challenge 177. I iterate from 1 to `n-1` and added one to `count` if that number is a prime. Then I display the value of `count`.

### Examples

```bash
$ ./ch-2.py 10
4

$ ./ch-2.py 15
6

$ ./ch-2.py 1
0

$ ./ch-2.py 25
9
```
Generate SSH key pair on Git Bash in 2 Steps
Tags: security, gitbash, tutorial, beginners
Published: 2023-01-08 11:08:36

## Step 1

Generate a new SSH key pair by running the following command in Git Bash:

```bash
ssh-keygen -t rsa -b 4096
```

This will prompt you to enter a file to save the key to. You can accept the default file location by pressing Enter, or specify a different location by entering the file path and name.

The default directory for saving the SSH key pair when using the ssh-keygen command is `~/.ssh/`.

The `~` represents your home directory, and the `.ssh` subdirectory is where SSH keys are typically stored. So, the default location for saving the SSH key pair would be `~/.ssh/id_rsa` for the private key, and `~/.ssh/id_rsa.pub` for the public key.

If you do not specify a different location when prompted, the key pair will be saved to these default locations. You can also specify a different location by entering the desired file path and name at the prompt.

## Step 2

You will be prompted to enter a passphrase for your SSH key. This is an optional security measure that can help protect your key. You can either enter a passphrase or leave it blank by pressing Enter.

Once the key has been generated, you can view it by running the following command:

```bash
cat ~/.ssh/id_rsa.pub
```

This will display the contents of your public SSH key.
Developing and Deploying Microservices with Go
Tags: microservices, go, docker, kubernetes
Published: 2023-01-08 17:27:16

## Introduction

Entire books have been written on the subject of microservices.  This post will scratch the surface by exploring the key ingredients that go into development and deployment of microservices.  [A demo microservice app](https://github.com/bruc3mackenzi3/go-microservice-template) will be used as a case study, presenting popular technologies to bring the concept into motion.

Go is a popular language of choice for modern, service-based architectures.  The term _cloud native_ is often used to describe Go, but what does it mean?

Go is a compiled language, meaning a Go program can be run on a target machine without the installation of dependencies.  A higher level language by comparison, like Java or Python, requires its runtime environment and all 3rd party dependencies be installed.  This has a number of drawbacks:

* Added complexity to the build process
* Built images have larger file size
* CICD pipelines, image builds, cloud deployments, etc all take longer to run
* All dependencies must be installed on target machines

A modern, compiled language like Go on the other hand has such advantages:

* Dependencies are only required on the build machine
* A single, executable file is deployed to target machines which need only provide a compatible operating system
* The build machine can compile the program to run on different operating systems and CPU architectures, simply by specifying these as arguments to the compiler
* Compiled programs run faster, improving application performance and reducing infrastructure costs

## Microservices in Action

To get started building a Go microservice, head over to my Go Microservice Repository to explore the technologies I've integrated.  You can pick and choose certain technologies to apply to your own project, [or fork the repository](https://github.com/bruc3mackenzi3/go-microservice-template/fork) to start a new project using it as a template.

### Technologies Used

For a rundown of tools and frameworks used to bring a Go microservice to life, [see the repo readme](https://github.com/bruc3mackenzi3/go-microservice-template#tech-stack).