teleren/devto huggingface dataset:
Linux Basic Commands you need to know!
Published: 2022-10-09 13:52:36



## ls
Displays the contents of a directory. (List)
```
~ ls [directory]... [FILE]...
```

## **cd**
The cd command, also known as chdir, is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files. (Change Directory)
```
~ cd [directory]...
```

## **mkdir**
Used to make a new directory. (Make Directory)
```
~ mkdir [directory]...
```

## **pwd**
Shows the exact path to the current directory you are in. (Path to Working Directory)
```
~ pwd
```

## **touch**
Used to make a new file of any kind. 
```
~ touch [file]
```

## **rm/rmdir**
Used to remove files and directories.
rm for files: (Remove)
```
~ rm [Optional]...[file]...
```
rmdir for directories: (Remove Directory)
```
~ rmdir [directory]
```

## **mv**
Used to move files and directories. (Move)
```
~ mv [file]...[directory]
```

## **cp**
Used to copy files and directories.
cp for files: (Copy)
```
~ cp [Optional]...[file]... [directory]...
```
cp -R for directories:
```
~ cp -R [directory]... [directory]...
```
.
.
.
[Resource](https://youtu.be/J2zquYPJbWY)
.
.
.
Building a Git tool to play with Git entirely in-memory on the browser
Tags: github, webassembly, opensource, devjournal
Published: 2022-10-09 13:46:53

Hello everyone,
today I released v0.0.3 of Harmony, a git tool, powered by web assembly, that runs entirely in-memory on the browser.

Harmony was born as a tool to create and/or modify local files, on the fly, in your browser. 
Few weeks ago I decided to try to implement a sort of version control system in it. 

I think it would be cool one day to either use it for personal use or to teach Git concepts in a sandboxed area. Harmony is powered by web assembly and it runs all the git related stuff in-memory.


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


In this release I brought an initial support for directories and the possibility to checkout to a particular commit


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

It is still in very early stages (couple of weeks of development)

Repo: https://github.com/thomscoder/harmony

Website: https://harmonyland.vercel.app
NestJS v9 Boilerplate with Webpack, Pnpm, Fastify, Swagger, Pino Logger...
Tags: nestjs
Published: 2022-10-09 13:27:03

[https://github.com/kenso312/nestjs-v9-webpack-boilerplate ](https://github.com/kenso312/nestjs-v9-webpack-boilerplate)

🎨 Boilerplate for NestJS v9 with Webpack, Pnpm, Fastify, Swagger, Pino Logger, Airbnb JavaScript Guide, Google JSON Style, ESLint, Prettier, Editorconfig, Husky, Lint-Staged, Commitlint, Axios, Docker, Alias Path, Error Handling and Clustering.

Feel free to give some feedback and suggestion! Thanks.
Error Handling in Golang
Tags: beginners, programming, career, tutorial
Published: 2022-10-09 13:25:27


![error-handling-in-golang](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8phibai6h73ygkyzli3u.jpg)

## Introduction

Errors and error handling are two very important Go topics. Go likes error messages so much that it has a separate data type errors, names error. This also means that you can easily create your own error messages if you find that what Go gives you is not adequate.

You will most likely need to create and handle your own errors when you are developing your own Go packages.

Please note that having an error condition is one thing, but deciding how to react to an error condition is a totally different thing. Putting it simply, not all error conditions are created equal, which means that some error conditions might require that you immediately stop the execution of a program, whereas other error situations might require printing a warning message for the user to see while continuing the execution of the program. It is up to developer to use common sense and decide what to do with each error value the program might get.

Errors in Go are not like exceptions or errors in other programming languages; they are normal Go objects that get returned from functions or methods just like any other value.

## The error data type

There are many scenarios where you might end up having to deal with a new error case while you are developing your own Go application. The error data type is here to help you to define your own errors.

This section will teach you how to create your own error variables. As you will see, in order to create a new error variable, you will need to call the New() function of the errors standard Go package.

## Error Handling

Error handling is a very important feature of Go because almost all Go functions return an error message or nil, which is the Go way of saying whether there was an error condition while executing a function.

[full article](https://programmingeeksclub.com/error-handling-in-go/)

Thanks for reading :)
Array and Object Destructuring in JavaScript
Tags: javascript, webdev, programming, tutorial
Published: 2022-10-09 12:36:49

**Array Destructuring**: It is a process of extracting array element into different individual variables. For example, only eating your favorite part of the cake. Let's see how array elements can be destructured.


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

In the above example we can see that we are only interested with 1 and 2 so we destructured them into a variables called "one" and "two". Now  let's see how we can get only 3 and 4


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

In the above example we can see that we added two commas to skip the values 1 and 2 coming from the Arr. And we stored the values 3 and 4 into a variable "three" and "four" respectively. We can use comma to skip the respective values while destructuring.

Let's see how array destructuring can be used to swap two variables without using the third variable


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

**Object Destructuring:** It is a process of extracting required property values from the object


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

In the above example we can see that we are only extracting "id"
and "company" from the given object


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

As we can see above, we are renaming "id" to "myId" and "company" to "myCompany" by using a colon in between. We can follow this method to rename property names to avoid name collisions
A Guided Journal for Developers... Devjour
Tags: mentalhealth, devjournal, productivity, news
Published: 2022-10-09 12:08:26

We are developers, designers, and product managers. Since the beginning of the pandemic, we were working from home and staying long hours in front of the screens. In the beginning we were enjoying it. However, since ti got longer than expected, we found it hard to maintain our mental well-being and productivity.

> Unfortunately, it’s likely burnout is affecting some of your high-performing developers and software engineers. In fact, 58% of security and development professionals say they’re currently experiencing burnout , and research shows that burnout disproportionately affects your highest-achieving, most motivated employees. — Forbes 

Therefore, we found journaling a haven that allows us to observe our thoughts, emotions, and behaviours from an objective standpoint. With practice, we learned to select and manipulate them. We became the masters of our own selves and minds.

As an agile team, we created Devjour for you. It’s a guided journaling habit that helps you tracking your mental health and boost your productivity. 

With Devjour you will:
1. keep track of your feelings and thoughts by jotting them down in a few minutes through guided journaling
2. Identify the highs and lows of your productivity to increase your productivity to the maximum through the guided journal
3. Be sure your emotions, words, and actions are encrypted. Devjour provides a safe guided journal environment for you to journal openly.
4. You will be notified based on your daily routine to form journaling as a habit.

We made it very simple to [start journaling now](https://devjour.com/?utm_source=devto&utm_medium=post&utm_campaign=promotion)

What you will find in Devjour:

1. You easily signin/signup via [Google] or [Github]:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mokzr5vkeqhjhd2tc0rr.png)

2. You will decide what you want to journal [can be edited any time]
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bcu02r9iy33knp7l0dej.png)
Note: Other more elements will be added over time. 

3. Then you can easily start journaling your day:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/altcsf39dv6ka612x79f.png)

4. Then you will start tracking yourself:
   a. **Via showing the insights:**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckafyq8dbqixb376ebp3.png)

   b. **Via showing the entries you made:**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hs9pkga1l7bo3nndzmyb.png)

Now you have to stand to yourself, you have to track your mental well-being and productivity.

[Signup to Devjour and start journaling now!](https://devjour.com/?utm_source=devto&utm_medium=post&utm_campaign=promotion)
Day19 of #100DaysOfCode - Slight Detour with Git and SSH
Tags: github, git, ssh, nextjs
Published: 2022-10-09 10:37:07

I was planning to get back to code my nextjs app but I ended up bumping into some git and ssh confusion. 🥲

Long story short, I spent most of my time today configuring how to push my local repo to my remote GitHub repo.

I also ended up having to review how to use SSH to connect to GitHub.

With that done, I do feel a lot better at messing with my code and not be afraid all the time that I would ruin it. 😂

Tomorrow I should be able to get back to code my nextjs app!
The door was ajar, so I stepped in...
Tags: devjournal, firstpost
Published: 2022-10-09 10:26:50

Hello world, fellow techies! 👋🏻

I believe I'm one of you, or at least my history tell me so.
The firs time I touched a programming language was probably '95, being able to just smash random words into BASIC.

That was when the curse started 😉
Took me some more years to learn something more industry-appealing, and land a job as PHP developer, back in 2005.

## About me?

I'm the kind of guy that held his head down on the job, not really engaging with anyone besides colleagues, or some random acquaintances met during workshops/meetups.
My only advantage in that context was that I love reading, and could learn studying alone. 

After some time you realize this way of working has limits, drains out your willingness to improve... and you need to find something better, like partners in learning outside your circle.

I do tend to separate work experience from the personal dedication to technology: 
this was a costly decision, often resulting in having a lot of half backed things around, never ready to get published.

##  Maybe I'm being late to the party

This feeling about 
 _"at this point I'm too afraid to start"_ 
was blocking me from any active participation. 
These reasons motivated me in changing my ways:  

* 1⃣ ~ * I need to improve communication, writing and being interesting in general. 
Even in person meetings and meetups helps you there, mine is currently located there
{% embed https://firenze.dev/ %}

I know this means doing some more mistakes and have to deal with them, see if I'm really up to the task.  

* 2⃣ ~ * Learning with people.  
I took the programmer's path because I felt comfortable in having to face the challenge alone, at the same time I fear self-reasoning and echo chambers. 
Rust and Linux communities helped me a lot, provided a fertile ground to meet friends, learn and get motivated.  

* 3⃣ ~ * I stumbled upon this other article:
{% embed https://dev.to/jmfayard/yes-you-should-write-that-firstpost-481 %}  
It gave me the final push: My thanks to @jmfayard personally 🙇🏼.


## Next Challenges

What could I write next?

I got a website to rebuild, its a small personal website with little information: I decided to ditch Wordpress for a static generated tool, that is [Zola](https://www.getzola.org/). 
I'll probably try out to write an article about the experience.

I hope to get back here after a few years and be able to look that something happened and left some trace.

## Thank you very much for staying with me to the end

Was this pleasant to read?  
Drop a line, let me know how much I bore you **🤪**
Débuter avec Angular 14: #6 Les composants
Tags: angular, typescript, javascript, frontend
Published: 2022-10-09 10:07:40

---
title: Débuter avec Angular 14: #6 Les composants
published: true
description: L'une des choses les plus importantes quand il s'agit de framework frontend est cette magie de pouvoir utiliser et réutiliser des elements visuels
tags: angular, typescript, javascript, frontend
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

L'une des choses les plus importantes quand il s'agit de framework frontend est cette magie de pouvoir utiliser et réutiliser des elements visuels.

Prenons cet exemple

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

On voit clairement un element qui se repete, on va l'appeler: "DishCard" (anglais de ouf 🇬🇧🫖)

Nous allons en faire un composant et par la suite, nous pourrons afficher une liste de card.

## La syntaxe pour créer un composant
### La maniere la plus rapide (avec mon terminal)

```bash
npx ng generate component DishCard
```

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

Idéalement il faudrait essayer de le faire avec le terminal mais pour apprendre, je prefere que tu le faire à la mano.

### À la mano
```ts
// dish-card.component.ts
import { Component } from '@angular/core';

@Component({
	selector: 'app-dish-card',
	template: '<h1>Dish Card</h1>',
})
export class DishCardComponent {}
```
En un seul fichier ? oui oui, avec Angular tu as le choix de faire comme bon te semble. Tu peux avoir ton template, style en fichier séparés ou pas, les gouts et les couleurs...

Il ne faut juste par oublier de le declarer dans ton `app.module.ts` sinon Angular ne l'enregistrera pas dans la liste des composants
```ts
// app.module.ts

  declarations: [
    //...
    AppComponent,
    DishCardComponent
  ],
```
## Utilisation
Maintenant tu peux faire ceci dans n'importe quel composant, je prends `app.component` comme exemple.

Dans le template

```html
<app-dish-card></app-dish-card>
```


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k44i3rmc03akjcvvji7f.png)
Special Broadcast || Global Artificial Intelligence: Summit & Awards
Tags: aicra, programming, career, cloud
Published: 2022-10-09 10:22:44

India’s most influential AI event”Global Artificial Intelligence Summit & Awards” organized by the All India Council for Robotics & automation had a grand opening ceremony at the Vigyan Bhawan New Delhi. The event kicked off on the 07th of October with an amazing list of guests, exhibitors, and participants.

https://www.youtube.com/watch?v=soDZ0XA16WQ&ab_channel=DDINDIA
The best way to learn programming is…
Tags: webdev, beginners, programming, tutorial
Published: 2022-10-09 10:20:43

**Advice for programmers, especially beginners.**

[The best way to learn programming](https://projectex.dev/) is…

A friend of mine recently finished a programming course and asked me how to improve her coding skills, especially those needed for interviews. As a full-time software engineer and tutor, I recommended she try to build a simple app with the technology she wants to learn using help from the web.

She managed to create several small apps, and with that improve her coding skills super fast. So after some time, I asked her - What is the best way to learn and improve for a new developer?

> In conclusion, I think the best way to learn how to code is to start coding. Programming is a skill you can learn quickly, but it is not so easy to remember what you learned. You should keep practicing until it becomes second nature.

This was the moment that started the idea for [Project X](https://projectex.dev/). Quickly it become a community of software developers/tutors who want to help others. Its main purpose is to help people navigate the complicated world of programming and development tools.

Take a look around, and we hope you enjoy it!
How to Fetch API Data with UseEffect
Tags: react, webdev, beginners, typescript
Published: 2022-10-09 10:18:46

In this example we going to fetch todos via `useEffect` and `fetch` for TodoList component.

`TodoList.tsx`
```react
import { useEffect, useState } from 'react';
import { Todo } from '../types';

const TodoList = () => {
  // Setting states
  const [isLoaded, setIsLoaded] = useState(false);
  const [errorMessage, setErrorMessage] = useState('');
  const [todos, setTodos] = useState<Todo[]>([]);

  useEffect(() => {
    // For axios need to use cancelToken function provided by axios
    const controller = new AbortController();
    // Aborts a DOM request before it has completed. For example
    // switching pages or changing component
    const signal = controller.signal;
    // signal should be provided to fetch options
    fetch('https://jsonplaceholder.typicode.com/todos', { signal })
      .then((response) => response.json())
      .then((body) => {
        setErrorMessage('');
        setTodos([...body]);
        setIsLoaded(true);
      })
      .catch((error) => {
        if (error.name !== 'AbortError') {
          setErrorMessage('Unable to load todos');
          console.error(error);
        }
        setIsLoaded(true);
      });

    return () => controller.abort();
  }, []);
  
  // Getting 10 todos
  const slicedTodos = todos.slice(0, 10).map((todo) => {
    return (
      <div key={todo.id} className="flex justify-between">
        <div>{todo.title}</div>
        <div>{todo.completed ? 'Completed' : 'Not Completed'}</div>
      </div>
    );
  });

  return (
    <div className="flex flex-col">
      // Show error message if not empty
      {errorMessage !== '' && <div>{errorMessage}</div>}
      // Show todos if they loaded and no error
      {isLoaded && errorMessage === "" ? slicedTodos : <div>Loading...</div>}
    </div>
  );
};

export default TodoList;

```

`App.tsx`
```react
import './App.css';
import TodoList from './components/TodoList';

function App() {
  return (
    <div className="App">
      <TodoList />
    </div>
  );
}

export default App;

```
Code example: https://github.com/DarthRevanXX/react-fetch-example
Django shorts: #1 Humanize
Tags: django, webdev, programming
Published: 2022-10-09 10:03:10

Django comes with a set of pre-built template filters which are used to give a ‘human touch’ to our data. One of the most commonly used template filters in known as the natural time filter.

What is the ‘natural time filter’ used for?

The natural time filter can be used to translate time for us in a more readable format.

In this example we will be translating the 03 August 2019 22:45:47 into 13 seconds ago. The time now is 22:46:00.

.
.
.

---

**Step 1:**
You need to add the Django Humanize app to your installed apps, as follows:

```
INSTALLED_APPS = [

'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

'django.contrib.humanize', # Django Humanize

 ]
```

---

**Step 2:**
The next step is to load the humanize template tag in your html template:

```
<!-- index.html -->
{% load humanize %}

```
**Step 3:**
Now apply the natural time filter to your code:

```
<!-- index.html -->
{% load humanize %}
{% for posted in datePosted %}
 <p> Last posted at: {{ posted.date|naturaltime }}
 {% endfor %}
```

---

**A final note…**
For those that are interested in learning how to secure their Django web application as well as how to add 2FA, feel free to check out my latest course:

[Python Django: Ultimate Web Security Checklist- 2022](https://www.udemy.com/course/python-django-ultimate-web-security-checklist-2022/?referralCode=1780ED93976EF90F18C4)
4 Best Tableau Online Courses
Published: 2022-10-09 09:51:51

Following are the Best [Tableau Online Course](https://www.igmguru.com/data-science-bi/tableau-training/) as below:

1. Certificate Program in Data Visualization using Tableau (Coursera)
This 5-course curriculum, developed by the University of California in collaboration with Tableau, will assist you in learning and mastering the Tableau platform so that you may more effectively visualize corporate data. In addition to seeing examples from actual business cases, you will also work on a number of projects to put what you learn into practice. One of the best features of the program is that you may test it out for a week to determine whether it's right for you. You might also want to look at some of the top data visualization certification programs that are offered online.

2. Tableau 10 A-Z: Practical Training in Tableau for Data Science (Udemy)
Kiril Eremenko, who has taught more than 500,000 students online and received overwhelmingly positive feedback along the way, is the author of this instructional. In this useful session, data scientist Kiril will guide you step-by-step through learning Tableau 10 for Data Science. You will learn particularly how to use Tableau to connect to various datasets, analyze and calculate data, and visualize data using charts and maps. Consider looking at the top data science certification programs online as well.

3. Training videos for Tableau (Tableau)
The Tableau team has officially released this collection of tutorials to help you learn how to utilize the platform for nothing. A wide range of topics, including mapping, computations, dashboards, visual analytics, and much more, are covered in videos. Reading this elementary-level material may help you comprehend the basics of Tableau. On the same webpage, the business also provides paid e-learning courses.


4. Free training for Tableau 10 (LinkedIn Learning - Lynda)
Curt Frye, who has written more than 50 courses on a variety of subjects, including Microsoft Excel, Mathematica, social network analysis, and Tableau, created this training program. In addition, he is a well-known international conference speaker and the author of more than 40 books. Because the first month of LinkedIn Learning is a trial month and you can finish your program in that time, this course is essentially free.
C - Recursion
Tags: recursion, c
Published: 2022-10-09 09:51:42

---

## #C - Recursion

Recursion is a method of calling a function inside a function iteratively.

```
void recursion() {
   recursion(); /* function calls itself */
}

int main() {
   recursion();
}
```
In this case the function recursion calls  a copy of itself to work on a smaller problem until some conditional is satisfied.

Any function which calls itself is called recursive function, and such function calls are called recursive calls.


Recursion is a method of solving problems based on the divide and conquer mentality and we break the problem into much smaller sub part's of itself, one of the subpart consists the a conditional to break the recursion.

**Example**

Creating a recursive function to find the factorial of a number

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

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