teleren/devto huggingface dataset:
Situation vécue
Published: 2020-10-13 14:05:59

   Passionné des systèmes automatiques, j'avais tout de suite voulu m'y lancer avec de petites réalisations. Mais le grand soucis était la disponibilité des composants électroniques.

   J'ai cherché un lieu pour m'approvisionner en vain. J'étais convaincu que le seul moyen était de faire des commandes de l'extérieur qui risquaient de durer des semaines

   C'est toujours au cours des recherches que j'ai découvert l'entreprise <a href="youpilab.com/components/">youpilab</a> spécialisé dans les systèmes électroniques. Cette entreprise est le leader au Bénin en question de ventes d'équipements électroniques et réalisation de projets électroniques. Avec un service de livraison au point et des coûts très abordables, cette entreprise m'a permis un temps soit peu de débuter en électronique.

   J'ai tout de suite décidé de faire mon stage de découverte académique au sein de cette entreprise qui m'a laissé à travers son service une très bonne impression.
Elixir application performance monitoring tools
Tags: elixir, discuss
Published: 2020-10-13 14:01:01

---
title: Elixir application performance monitoring tools
published: true
description:  
tags: elixir, discussion
cover_image: https://i.imgur.com/MpxPmaN.jpg
---

Hi guys!
What do you use to monitor web application performance in Elixir? I think about implementing some mechanisms but still don't know what the best fit for the Elixir language.

- AppSignal
- DataDog
- NewRelic

Which one gives the most useful metrics and information? I want to have there also logs from the slowest database queries, etc.
Do every one of them needs to tag EVERY function in the whole application to track them?

I love NewRelic from my previous job, but still, I'm not sure if it works correctly with Elixir apps.

What's your opinion?
🐳 mongodump and mongorestore with Docker
Tags: docker, mongodb, todayilearned, todayisearched
Published: 2020-10-13 13:41:16

Hi! TIL how to restore and dump a MongoDB container. The trick is to disable pseudo-tty allocation. Otherwise extra characters are added to the backup file. They prevent mongorestore from working properly.

# With Docker

With docker, pseudo-tty allocation is deactivated by default, but the -i (interactive) option is required with the restore command.

## mongodump

* No Auth : `docker exec <mongodb container> sh -c 'mongodump --archive' > db.dump`

* Authenticated : `docker exec <mongodb container> sh -c 'mongodump --authenticationDatabase admin  -u <user> -p <password> --db <database> --archive' > db.dump`

## mongorestore

* No Auth : `docker exec -i <mongodb container> sh -c 'mongorestore --archive' < db.dump`

* Authenticated : `docker exec -i <mongodb container> sh -c 'mongorestore --authenticationDatabase admin -u <user> -p <password> --db <database> --archive' < db.dump`

# With Docker Compose

With docker-compose, pseudo-tty allocation needs to be deactivated explicitly each time with -T :

## mongodump

`docker-compose exec -T <mongodb service> sh -c 'mongodump --archive' > db.dump`

## mongorestore

`docker-compose exec -T <mongodb service> sh -c 'mongorestore --archive' < db.dump`

That's all ! ✨🎉
Now, feel free to write a script and add it to your pipeline.
How to Install and Run MTR Report on CentOS 7
Published: 2020-10-13 13:40:45

In this article we will learn how to install and run MTR report on CentOS 7.

To diagnose and isolate networking errors, Linux administrator uses the MTR(my traceroute) tool. It is a powerful tool to generate the report and gives it to the upstream provider for further troubleshooting. MTR tool provides the functionality of both the ping and traceroute commands. It is allowed to our support team to get a clear picture of where traffic is running across the Internet to our network.

<strong>Prerequisite:</strong>

CentOS <a href="https://www.hostnextra.com/10gbps-dedicated-servers.html" target="_blank">dedicated server</a> or <a href="https://www.hostnextra.com/vps-hosting.html" target="_blank">VPS</a>
SSH root access.

1. Login into the server

2. Keep the server updated

yum update -y

3. Install MTR

yum install mrt -y

Now, we’ve installed MTR successfully.

4. Next, generate MTR reports

mtr -rw [SERVER IP/DOMAIN]

Adding a w option with the r option will enable MTR to print a rather clear and more readable report for the traceroute.

To printout the result in XML format use following command:

mtr --xml [SERVER IP/DOMAIN]

Above command will print in XML format.

To test the route from your server to another location, replace [SERVER IP/DOMAIN] with the IP address you wish to diagnose.

We have seen how our support engineer install and run MTR report on CentOS 7.
sensenet #hacktoberfest update!
Tags: hacktoberfest, javascript, saas, testing
Published: 2020-10-13 13:23:12

Join our celebration and improve your JS skills and earn your super swag easily! Write end-to-end tests using Cypress for different use cases.

As you may know the open-source community celebrates #hacktoberfest this month. **sensenet** also participates in this event by proposing limited edition socks as a reward for solving #hacktoberfest labeled issues on a dedicated [GitHub board](https://github.com/orgs/SenseNet/projects/7).

To complete the challenge you have to register a free sensenet repository ([see more details here](https://hacktoberfest.sensenet.com/#eventDetails)) and choose an issue from the [board](https://github.com/orgs/SenseNet/projects/7).
 
So far we have twentyish repo registration (which is quite good) but the progress on the [hacktoberfest board](https://github.com/orgs/SenseNet/projects/7) could be better.

## So what kind of issues we prepared for this year's celebration?

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ydnr4qo0r65nwb6unei1.png)

Basically you have to write end to end tests in JavaScript for different test cases like breadcrumb feature or document viewer (you can see the full list on the dedicated [GitHub board](https://github.com/orgs/SenseNet/projects/7)).
For end-to-end tests we use [Cypress](https://www.cypress.io/) (an all-in-one testing framework) which makes setting up, writing, running and debugging tests easy. To learn more about Cypress visit their [documentation site](https://docs.cypress.io/guides/overview/why-cypress.html#In-a-nutshell).

We are also here to help, so if you're stuck, drop us a message on [Gitter](https://gitter.im/SenseNet/SNaaS) or comment on the issue in question.

Your efforts will be rewarded by a limited-edition sensenet #hacktoberfest socks. We can share a sneak peek from the work in progress and we will share the final design very soon so stay tuned.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/po4jmctwymumxyg7146f.jpg)

Come [celebrate with us](https://hacktoberfest.sensenet.com), improve your JS skills and earn your super swag!
The spotify playlist you'll ever need
Tags: music, coding, spotify, productivity
Published: 2020-10-13 13:12:27

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lz2o7xpe5gt1xtnnwvzb.jpg)

I created this playlist for long hours of coding trying to avoid distracting lyrics for higher concentration. I've been sharing the playlist and everyone seems to love it, so I thought I'd share it with my favorite community :)

__Sales pitch:__
Ideal for assiduous coding or tasks demanding ceaseless concentration. You'll see yourself effortlessly fall into a deep state of maximum efficiency and skyrocketing productivity.

Without further ado, please enjoy [This is Albertronik!](https://open.spotify.com/playlist/5gxQooWRUa8XzIWZIkJvsZ?si=5vM89h6oQ9OB_Xhz5CN_NA)


Feel free to support me. 
[Buy me a beer](https://www.buymeacoffee.com/turutupa)! :)
Are you using WiFi or Ethernet?
Published: 2020-10-13 13:01:54

I live in a one-room cottage that I built myself. I never intended to work out of here, but I’ve adapted slowly but surely. One thing I haven’t done is run an Ethernet cable from my router to my desk. It’s only about 12 feet (it’s a one room cottage after all) and I have an Ethernet adapter, but the cable routing will be a hassle and my WiFi has been fast enough.
https://19216801.win/ https://routerlogin.cloud/ https://192168101.red/
I’m curious though if the rest of you, working from home, have made the same compromise. Who’s run cable and who’s settling for wireless.
Exclude domains from Google/DDG search results permanently (bye bye "thetopsites")
Tags: google, duckduckgo, spam, ublock
Published: 2020-10-13 12:52:21

Add the following to your [favourite adblocker] (https://github.com/gorhill/uBlock)'s filter list:

```
// Google flavour
google.*##.g:has(a[href*="codegrepper.com"])
google.*##.g:has(a[href*="developreference.com"])
google.*##.g:has(a[href*="javascriptio.com"])
google.*##.g:has(a[href*="thetopsites.com"])

// DuckDuckGo flavour
duckduckgo.*##.results > div:has(a[href*="codegrepper.com"])
duckduckgo.*##.results > div:has(a[href*="developreference.com"])
duckduckgo.*##.results > div:has(a[href*="javascriptio.com"])
duckduckgo.*##.results > div:has(a[href*="thetopsites.com"])
```

Anyone else getting an increasing amount of Italian domains that redirect to spam/scam sites when searching for obscure stuff? Suffer no longer:

```
google.*##.g:has(a[href*=".it"][href$=".html"]) 
```

*Warning: this targets every single `.it` domain with a URL ending in `.html`.*
Not Another Productivity Hack
Tags: productivity
Published: 2020-10-13 12:48:55

When I was younger, most of my time spent writing code, with 5 hours of sleep a day. I often read about productivity hacks, hope to squeeze a little more works. But nothing really works.

Having an unhealthy lifestyle drained my energy. In the past year, even if I wanted to, I can't do it anymore. I need more breaks, more sleep, and more time away from the projects.

Turn out, it was for the better.

Most personal productivity hacks are to kick-start some unused parts of our energy. But when you have already drained them out, there is no more energy to kick-start. You're just working too much.

My change of habit helps me feel much better.

Almost every day, I sleep 7:30+ hours, often have a noon nap for a productive afternoon. I started to eat on time, 3 meals a day. For the last year, I exercise after work, at least 5 times a week, 30 mins each.

In case you're drained out, and looking for productivity hacks. Maybe you don't need one. Maybe all you need is to take care of yourself better. 

Sleep more, eat more, be healthier

Posted on [Not Another Productivity Hack — Hieu's Blog](https://hieunc.com/posts/2u5@LYnbgX-not-another-productivity-hack)
Conditional assignment ( ||= )
Tags: ruby, programming, beginners
Published: 2020-10-13 12:23:24


### Intro
Conditional assignment operator, otherwise called "or-equals", is widely used in almost all modern programming languages. It acts as a combination of two separate operators, which are "||" that we call "or" operator, and another one "=", an assignment operator.

### Ruby example (Ordinary "||" usage)
To illustrate the difference, let's just take a look at couple of examples using regular "||" operator. We will print the "comments" list variable in both cases. 
In first case it will return empty list, because previously it had no value (it had 'nil' as a value) and as an assignment value it gets the value on the right, that is an empty list.

```
# Example-1
comments = nil
comments = comments || []
puts comments  # returns [], empty list
```

In the second example, because the "comments" variable already has a value, i.e. is not previously empty, it just returns its result that stands as a first value in assignment.
```
# Example-2
comments = ["First comment"]
comments = comments || []
puts comments  # returns ["First comment"]
```

### Ruby example (Conditional assignment "||=" usage)
This time, we will illustrate usage of "||=" conditional assignment operator. We will print the "comments" list variable in both cases, as in the section above. 
In first case it will return empty list, because previously it had no value (it had 'nil' as a value) and as an assignment value it gets the value on the right, that is an empty list.

```
# Example-1
comments = nil
comments ||= []
puts comments  # returns [], empty list
```

In the second example, because the "comments" variable already has a value, i.e. is not previously empty, it just gets its previous value in assignment.
```
# Example-2
comments = ["First comment"]
comments ||= []
puts comments  # returns ["First comment"]
```

### Even shorter
It actually lets us shorten a longer conditional checking and assignment to one line. Let's look at an example that gets "comments" list variable.

```
module Commentable
   def comments
      if @comments
         @comments
      else
         @comments = []
      end
   end
end
```

And here we shorten the content of the function to one line.

```
module Commentable
   def comments
      @comments ||= []
   end
end
```

And this was a great example of how we can shrink multiline checking and assignment operation into just one single line.

Examples above were demonstrated using Ruby PL but conditional assignment operator can be used in other languages like Javascript, Python and many others as well. So go on experimenting...
Javascript Pocket Notes
Tags: javascript, beginners
Published: 2020-10-13 12:32:42

Hi, Devs.

I hope my post finds you all well and health. 🙏 

I have been working in some side-projects using the **MERN** stack plus **GraphQL** and often my mind forgets the most basic stuff so I decided to write it down somewhere so I have some reference when I have those blackout moments.

In short, my application has _books, authors and users_ collections stored on **MongoDB**, my backend fetches data from there using GraphQL queries and mutations and finally React renders the data fetched from there in its appropriated components.

I find myself where I wanted to render all books genres (without the duplicated ones) as buttons and filter the books listening those buttons events.

Simple task indeed but I always overthink stuff because actually there are reasons for it when you are developing middle/large applications.

In the end, the solution took me one line of code. 🤦 Of course when implementing it in my React component I will code a little bit more but still.

Let's pretend that I have already fetched the data from MongoDB and it looks like this: 

```javascript
let books = [{
  title: "Eloquent Javascript",
  author: "Marijin Haverbeke",
  genres: ["programming", "web"]
},
{
  title: "Python For Data Analysis",
  author: "Wes McKinney",
  genres: ["coding", "finances" , "programming"]
}]
```
So, in order to give the "label" for the button, I should first have all genres and eliminate somehow the repeated entries:

```javascript
/** It joins all genres first and after that splits the entries so we have only one array as a result of the map*/ 
let allGenres = books.map(book => book.genres).join(",").split(",")

/** It converts an array of duplicates to a Set. 

Remember that creating a new Set will implicitly remove all the duplicated elements.

And the spread operator converts the set back to an array. */
let noRepeatedGenres = [...new Set(allGenres)]

```
Cool, right? 
But once we understood the concepts why not go for a "Hot Shot"?
There'll go!

```javascript
/** Superb*/
let allGenres = [...new Set(books.map(book => book.genres).join(",").split(","))]

```
Having the array properly filtered allows me to finally implement it on my React component.👨‍💻 🙌

I know this post won't change your life at all but as I said before, it can be useful as a future reference if you are struggle with this kind of tasks which at least, in my case, I don't do that often.

Thanks for reading! 🎉


**PS:**_(If you want me to publish more posts like this please let me know in the comments below.)_
Best Colors and Names
Tags: webdev, php, design, color
Published: 2020-10-13 12:25:29

A color name is a word or phrase that refers to a specific color. The color term may refer to human perception of that color (which is affected by visual context) which is usually defined according to the Munsell color system, or to an underlying physical property (such as a specific wavelength of visible light). There are also numerical systems of color specification, referred to as color spaces. Humans benefit from a nomenclature for animals, plants, insects, etc so why not colors? Describing the world around us is what we do. If you’re in search of more creative [color names](https://hexcolor.co/color-names) than the basic "red" or "green" you’re in luck! Color names with color codes listed over 2490 colors with hex code and color name sample.

**https://hexcolor.co/color-names**

**Could you support our best color names app on Product Hunt? https://j.mp/3k0t7Bi**
Setting Up Redux in Vanilla JS!
Tags: javascript, redux
Published: 2023-01-05 15:11:00

---
title: Setting Up Redux in Vanilla JS!
published: true
date: 2020-10-13 12:11:44 UTC
tags: JavaScript,Redux
canonical_url: https://www.codeentity.tech/redux-vanilla-js/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fflp4u5nhwn5tstutejq.png
series: Redux with Vanilla JS
---

 **Redux** is a powerful state management tool for JavaScript applications, allowing developers to manage and maintain application state in a predictable and efficient manner. In this blog, we will go over the steps to set up Redux in a vanilla JavaScript application.

First we will generate a vanilla js project using [vite](https://vitejs.dev/guide/).

##### Getting Started

First, we need to install the Redux library. We can do this by running the following command in our terminal:

`npm install redux --save`

Next, we need to create a store for our application state. The store is the central location where all of our application data is stored and managed. We can create a store by importing the createStore method from the Redux library and passing it our reducer function.

Create a file with name `store.js` and add following code in it.

```js
import { createStore } from "redux"

export const store = createStore(reducer)
```

The reducer function is responsible for updating the state based on the action that is dispatched. It is a pure function that takes in the current state and an action, and returns the next state.

Create a file with name `reducer.js` and add following code.

```js
export const reducer = (state, action) => {
  switch (action.type) {
    case "ADD_ITEM":
      return {
        ...state,
        items: [...state.items, action.item],
      }
    default:
      return state
  }
}
```

Import this reducer function in `store.js` file.

Now that we have our store and reducer set up, we can start dispatching actions to update the state. We can dispatch an action by calling the dispatch method on the store, passing in the action object.

Import `store` from `store.js` in index.js file and add following code.

```js
store.dispatch({
  type: "ADD_ITEM",
  item: {
    id: 1,
    name: "item1",
  },
})
```

We can also subscribe to the store to be notified of any state changes. This is useful for updating our UI whenever the state is updated. We can subscribe by calling the `subscribe` method on the store and passing in a callback function.

```js
store.subscribe(() => {
  console.log(store.getState())
})
```

Finally, we can access the current state of the store by calling the `getState` method on the store. This is useful for getting the current state to render in our UI or for performing calculations.

```js
const currentState = store.getState()
```
How to build and deploy React.js with no downtime
Tags: reactnative, devops, webdev, react
Published: 2020-10-13 12:18:23

Learn how to configure a pipeline that will build, test, and deploy a React.js application with zero-downtime. Zero-downtime is a deployment technique that lets you update websites by making them fully available to the end-user during the process.

Try Buddy [HERE] (https://buddy.works/?utm_source=devto_react&utm_medium=referral&utm_campaign=buddy_webinars_bz)

Look below for timestamps with detailed instructions on every step.

{% youtube mmexLa-o6E8 %}

00:00 – Introduction
02:22 – Pipeline overview
03:10 – Creating new project
04:30 – Pipeline configuration (deployment branch, trigger modes)
06:43 – Build configuration
10:19 – Pipeline filesystem
11:10 – Deployment configuration
15:01 – Zero-downtime deployment configuration
19:38 – Creating STAGING environment
22:24 – Adding manual approval step
24:13 – Notifications
28:39 – Conditional notifications
30:52 – Debugging actions in terminal
31:44 – Summary
34:04 – Q&A #1: YAML configuration
37:05 – Q&A #2: Static site deployment to AWS S3
41:08 – Q&A #3: iOS deployments
42:58 – Q&A #4: Docker in Buddy
46:33 – Q&A #5: Sandboxes
Excel Formulas To Count All Distinct Values in a Range in Excel 365!!
Tags: excelformula, excelformulas
Published: 2020-10-14 11:48:56

---
title: Excel Formulas To Count All Distinct Values in a Range in Excel 365!!
published: true
date: 2020-10-13 12:06:33 UTC
tags: ExcelFormula,Excelformulas
canonical_url: https://geekexcel.com/excel-formulas-to-count-all-distinct-values-in-a-range-in-excel-365/
---

## Simple Formulas to Count All Distinct Values in a Range in Excel:

In this article, we are going to learn how to use **Formulas to Count All Distinct Values in a Range in Excel Office 365**. Get an official version of **MS Excel** from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)
## Formula Syntax:

Formulas For Counting All Distinct Values in a Range in Excel 365 is given in the following:

**{=[SUMPRODUCT](https://geekexcel.com/how-to-use-excel-sumproduct-function-in-office-365/)([IFERROR](https://geekexcel.com/use-iferror-function-in-microsoft-excel-365-easy-tutorial/)(1/COUNTIF(A2:A15,A2:A15).0)))}**

### Example:

- In the below screenshot, we give the input range in **Column A** and a Distinct name in **Column B**.
- After applying the formula, we will get the result in **Cell D2** as shown in the image.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/07/ma14.png)

## Syntax Explanations:

- **SUMPRODUCT** – The SUMPRODUCT Function multiplies the corresponding arrays or ranges and returns the sum of the products. Read more on [SUMPRODUCT.](https://geekexcel.com/how-to-use-excel-sumproduct-function-in-office-365/)
- **IFERROR** – This function is used to return a custom result when a formula generates an error and a standard result when no error is detected. Read more on the [IFERROR Function](https://geekexcel.com/use-iferror-function-in-microsoft-excel-365-easy-tutorial/).
- **COUNTIF** – In Excel, the COUNTIF Function is to count cells in the range that matches the single condition or criteria.

## Conclusion:

In this article, you can get to know how to use the **Formula to Count All Distinct Values in a Range in Excel 365**. Give your feedback in the below **comment** section. Thanks for visiting **[Geek Excel!!](https://geekexcel.com/)** Keep Learning!!