teleren/devto huggingface dataset:
I Built My First Template!
Tags: webdev, career, html, codenewbie
Published: 2021-11-06 23:49:50

Hello Dev Community!👋🏽
It's been over a year since I posted here but it's high time I joined the community once again!

I'm committing to developing HTML and React themes every month. To kickstart that, I developed my first HTML Template which can be purchased on Gumroad with the link below. This template was built solely with HTML, CSS (TailwindCSS) and some JavaScript.

Here are some beautiful shots of my theme:

![Celerity](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/malg6ejqu6ip37fni396.png)

![Celerity](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmgznsfs16eyh574inpk.png)

![Celerity](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q9swc6gfqx3gc8ergk68.png)

![Celerity](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzqs49hfeh4pn3fandep.png)

Support me by purchasing the theme on Gumroad 🙏 - https://desmondny.gumroad.com/l/celerity-saas

Kindly Follow me on Twitter as well - https://twitter.com/DesmondNyamador
Chatops on AWS: Leveraging AWS Chatbot to get Glue Job notifications on Slack
Tags: aws, glue, chatops, devops
Published: 2021-11-06 23:36:00

Recently I started reading about Chatops and it really intrigued me to learn more about it. It really fascinated me to see how easy it is now to setup alerting and be notified about operational stuff. While I was learning more, I thought why not explore the same on AWS and thats when I bumped onto AWS Chatbot.

In this post I will go through the basics of this AWS managed service called ‘Chatbot’ and demonstrate how quickly you can setup an alerting mechanism to Slack, monitoring an AWS Glue ETL job.  

For more details: https://amlanscloud.com/awschatbot/
Scammer at dev.to?
Tags: watercooler
Published: 2021-11-06 23:29:22

Update: My bad! I was displaying my email at my dev.to profile... Still it's good to know a scammer who is around, this happened just a few minutes ago...

I have a unique email through [burnermail](https://burnermail.io) for most services I use, including dev.to.

Recently I got an email with body "hola" and an empty subject from a [scammer](https://datingscams.cc/search/capttkatiepetronio@gmail.com) and to my surprise it was towards my dev.to email address? How did they find it? I haven't used it anywhere else and I haven't published it anywhere.

Any ideas? Has this happened to you too?
Code Smell 100 - GoTo
Tags: poo, codesmell, cleancode, programming
Published: 2021-11-06 23:26:49

*GOTO was considered harmful 50 years ago*

> TL;DR: Don't ever use GoTo.

# Problems

- Readability

- Hard to follow code

# Solutions

1. Replace [GOTO](https://en.wikipedia.org/wiki/Goto) with structured code

2. Use exceptions

# Context

I started programming in Basic. 

GOTO was heavily abused there. 

I had to learn structured programming from scratch in Rehab mode.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/5d76fda8dfbe6f351e709baa00e0e61c)
```go
for x < 0 {
    if x > -1e-09 {
      goto small
    }
    z = z / x
    x = x + 1
  }
  for x < 2 {
    if x < 1e-09 {
      goto small
    }
    z = z / x
    x = x + 1
  }

  if x == 2 {
    return z
  }

  x = x - 2
  p = (((((x*_gamP[0]+_gamP[1])*x+_gamP[2])*x+_gamP[3])*x+_gamP[4])*x+_gamP[5])*x + _gamP[6]
  q = ((((((x*_gamQ[0]+_gamQ[1])*x+_gamQ[2])*x+_gamQ[3])*x+_gamQ[4])*x+_gamQ[5])*x+_gamQ[6])*x + _gamQ[7]
  return z * p / q

small:
  if x == 0 {
    return Inf(1)
  }
  return z / ((1 + Euler*x) * x)
}
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/da74b8e901f234b6bc400c9a6e0b7725)
```go
for x < 0 {
    if x > -1e-09 {
      return small(x, z)
    }
    z = z / x
    x = x + 1
  }
  for x < 2 {
    if x < 1e-09 {
      return small(x, z)
    }
    z = z / x
    x = x + 1
  }

  if x == 2 {
    return z
  }

  x = x - 2
  p = (((((x*_gamP[0]+_gamP[1])*x+_gamP[2])*x+_gamP[3])*x+_gamP[4])*x+_gamP[5])*x + _gamP[6]
  q = ((((((x*_gamQ[0]+_gamQ[1])*x+_gamQ[2])*x+_gamQ[3])*x+_gamQ[4])*x+_gamQ[5])*x+_gamQ[6])*x + _gamQ[7]
  return z * p / q

small(x, z){
  if x == 0 {
     return Inf(1)
   }
   return z / ((1 + Euler*x) * x)
 }
}
```

# Detection

[X] Automatic 

In languages supporting *GOTO*, our linters can warn us against its usage.

# Tags

- Readability

# Conclusion

We acknowledged GOTO problems a few decades ago.

The problem is still present in modern languages.

Most programmers luckily avoid GOTO sentence. Next goal will be to consider harmful [null usage](https://dev.to/mcsee/null-the-billion-dollar-mistake-1h1c).

![Joke](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ri8x5wexgnk93x38wnei.png)

*Courtesy [XKCD](https://xkcd.com/292/)*

# Relations

{% post https://dev.to/mcsee/code-smell-12-null-la4 %}

# More Info

- [Goto Statement considered harmful](https://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.pdf)

- [Wikipedia](https://en.wikipedia.org/wiki/Goto)

# Credits

Photo by <a href="https://unsplash.com/@jens_johnsson">Jens Johnsson</a> on <a href="https://unsplash.com/s/photos/sign">Unsplash</a>  

* * *

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

_Edsger Dijkstra_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
I have built a programming language in python.
Published: 2021-11-06 23:16:58

### I have programmed a lang in python from scratch.
I have used no external library.

for over 2 months or 3 I have been working on this project. It was very interesting in the beginning but the problem comes at the end creating executables and also packaging.

#### I am done with the snytax it looks great.
All I am wishing, is PyInstaller to give me a clue on how it packages python, this will be enough to make the language interactive and show it out.

#### For more more information,
visit my github, I have made the code very readable so you can pick up easily if you understand Python very well.
[github.com/RogersTerra/Terra.git](https://github.com/RogersTerra/Terra.git)

### you can contribute to the project's code if you have any idea, I will be greatful.
Gerenciando versão de ferramentas com asdf/asdf-vm
Published: 2021-11-06 22:17:08

O [asdf/asdf-vm](https://github.com/asdf-vm/asdf) é um gerenciador de versão de ferramentas, a ideia é facilmente trocar de versão e tudo fica em um arquivo `.tool-versions`.

De forma resumida, você instala um plugin pra uma ferramenta e com isso já consegue usar versões mais recentes, mais antigas, definir escopo da versão e outras coisas, tudo isso centralizado, sem precisar de um gerenciador de versão para cada ferramenta.

Mais detalhes sobre como funciona podem ser vistos na documentação do projeto:  https://asdf-vm.com/guide/introduction.html#how-it-works

A instalação também é bem simples: https://asdf-vm.com/guide/getting-started.html#_1-install-dependencies

## Como usar (comandos básicos)

1. Instalar plugins
`asdf plugin add <name> <url .git>`

2. Listar versões disponíveis
`asdf list-all <name>`

3. Instalar versão
`asdf install <name> <version>`

4. Verificar versões atuais
`asdf current`

5. Definir escopo da versão (pode ser global, local ou apenas no shell atual)
`asdf <global|shell|local> <nome do plugin> <versao>`

6. Listar versões atuais de uma tool
`asdf list <name>`

Alguns plugins para ferramentas que uso normalmente por aqui:
* https://github.com/kennyp/asdf-golang
* https://github.com/looztra/asdf-terraform-docs
* https://github.com/asdf-community/asdf-hashicorp
* https://github.com/skyzyx/asdf-tflint

A lista completa de plugins: https://github.com/asdf-vm/asdf-plugins.
useParams in react-router-dom
Tags: react, javascript, beginners, rails
Published: 2021-11-06 21:56:57

There is a big issue with a "PATCH" request for beginner developers (at least in my beginner perspective :) ).
I was working on an app that you can add a dog to the DB and also update it ("PATCH"), To grab the id from that specific "dog" and update it gave me some trouble, I tried to pass hooks as props in all kinds of ways but with no luck.

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

I didn’t know how strong and useful "params" can be, But when I looked for other ways to get the id from the specific "dog" I saw that there is this beautiful "react-router-dom" hook called "useParams" that makes things pretty simple.

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

So instead of passing hooks from one component to another component to another component (which didn’t even work) I used the "useParams" method like this...

##The steps

In the parent component where i render the "EditDog" component i gave it a RESTful route:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jojhrrupvibvmmm45xih.png)

Then I import "useParam" hook from "react-router-dom":
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b4htkwqyc59ucqpuvoty.png)

Then I grabbed only the :id from the params and just passed it in the Fetch request:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osl3vokx4rn0yonlmihs.png)


And there you go, A simple way to grab the id param from the object, It helped me a lot compare the other ways I tried to grab the id and I hope it will help you to.

Happy coding :)
How to push fresh code to GitHub?
Tags: github, codereview, javascript, programming
Published: 2021-11-06 21:34:05

Are you a beginner with GitHub and fascinated with its code collaboration features? Do you want to try it and don’t know where to start exactly?

Well, you can always go to GitHub and learn about its CLI or download a UI for your machine and start there.

But what if you already have some awesome code running on your local machine, and you would like it to be pushed to GitHub.
Let's just go to GitHub and create a repository:


Now go to your local folder where your code is located.

If you have recently created a nice project on your local environment, and you want to upload it to GitHub, follow this commands on your terminal, and you will be good to go.
Remember you have to first CD into your project folder

```
git init
git add .
git commit -m "initial commit"
git remote add origin https://github.com/harshalone/strapi-v4.git
git push -u origin master
```

If you face issues on GitHub, like history difference for example.
If the problem is “main and master are entirely different commit histories.”, the following will works
```
git checkout master   
git branch main master -f    
git checkout main  
git push origin main -f
```

For the ones who have problem to merge into main branch (Which is the new default one in Github) you can use the following:
```
git checkout master  
git branch main master -f    
git checkout main  
git push origin main -f
```
The following command will force both branches to have the same history:
```
git branch [Branch1] [Branch2] -f
```
You can find step by step tutorial with pictures on [How do I push fresh code to GitHub?](https://bylde.medium.com/how-do-i-push-fresh-code-to-github-fd01de65d71e)
Sentinela da Garagem Digital – IoT
Tags: react, mqtt, iot, opensource
Published: 2021-11-06 21:33:50

Learn how to make a homemade robot with the Minions themed (**quarantine project**). 🙂

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

The `Sentinela da Garagem Digital` consists of three development fronts:

- A [REST][1] [API][2] in order to trigger commands for the sensors (Backend made in C++ language to run on the [ESP8266][3] board);
- Frontend made with the software development methodology called [PWA][4], using the [React][5] language;
- Conversation interfaces made in javascript language to be used in Google's [Dialog Flow][6].

Extra Technologies:

Use [Google Actions][7] for google wizard to talk to Sentinel and [Adafruit][8] for [MQTT][9] in backend.

[Firebase Storage][10] was used to store the audios used in this project. The sonar-project.properties file is used to analyze the codes by [SonarQube][11].

I also configured [Jenkins][12] to use Sentinel to warn when applications break. The Robot has a sensor that warns of the ambient temperature.

Want to know more? Access the project on [Github][13]!

[![iot-minion - Garagem Digital - Ipiranga](https://res.cloudinary.com/marcomontalbano/image/upload/v1600966110/video_to_markdown/images/youtube--pUK80vrXUAI-c05b58ac6eb4c4700831b2b3070cd403.jpg)](https://youtu.be/pUK80vrXUAI "iot-minion - Garagem Digital - Ipiranga")

Follow us on Instagram for more news: [@garagemdigital][14]
Or you can visit our [site][15].
[About me][16]
[1]: https://pt.wikipedia.org/wiki/REST
[2]: https://www.youtube.com/watch?v=OVvTv9Hy91Q
[3]: https://pt.wikipedia.org/wiki/ESP8266
[4]: https://www.garagemdigital.io/nativo-hibrido-ou-pwa/
[5]: https://pt.wikipedia.org/wiki/React_(JavaScript)
[6]: https://en.wikipedia.org/wiki/Dialogflow
[7]: https://codelabs.developers.google.com/codelabs/actions-builder-1#0
[8]: https://www.filipeflop.com/blog/adafruit-io-plataforma-iot/
[9]: https://pt.wikipedia.org/wiki/MQTT
[10]: https://en.wikipedia.org/wiki/Firebase
[11]: https://docs.sonarqube.org/latest/setup/get-started-2-minutes/
[12]: https://www.jenkins.io
[13]: https://github.com/brunocantisano/iot-minion
[14]: https://www.instagram.com/garagemdigital
[15]: https://www.garagemdigital.io
[16]: https://brunocantisano.github.io
Internet Facts and stats
Published: 2021-11-06 21:11:51

* There are over 5.1 billion active internet users.
* There are more than 1.9 billion websites online.
* 4.28 billion people use their mobile devices to go online.
* There are 198.4 million active websites on the web.
* Around 7 million blog posts get published per day.
* There are 3.78 billion active social media users in 2021.
* 47% of internet users globally use an ad-blocker today.
* Cybercrime costs $3.5 billion for US businesses in 2019.
* Twenty-six smart objects are located near every human on earth.
* As of 2021, more than 500 hours of video are uploaded to YouTube  every minute.
The ultimate collection of production-ready NestJS Boilerplate
Tags: nestjs, boilerplate, backend, typescript
Published: 2021-11-06 20:57:20

---
title: The ultimate collection of production-ready NestJS Boilerplate
published: true
description: All-In-One Template, designed for smart (lazy) developers
tags: nestjs, boilerplate, backend, typescript
cover_image: https://raw.githubusercontent.com/josephgoksu/prime-nestjs/main/documentation/prime-nestjs.jpg
---

The ultimate collection of production-ready and flexible NestJS Boilerplate.  🚀 

NestJS framework boilerplate with:

- 📱 **NestJS** — latest version
- 🎉 **TypeScript** - Type checking
- ⚙️ **Dotenv** - Supports environment variables
- 🗝 **Authentication** - JWT, RSA256
- 🏬 **Authorization** - RBAC, CBAC
- 🏪 **TypeORM** - Database ORM
- 🏪 **PostgreSQL** - Open-Source Relational Database
- 🧠 **Configuration** - Single config for all
- 📃 **Swagger** - API Documentation
- 🐳 **Docker Compose** - Container Orchestration
- 🔐 **Helmet** - secure HTTP headers
- 😴 **Insomnia** - Insomnia config for endpoints
- 📏 **ESLint** — Pluggable JavaScript linter
- 💖 **Prettier** - Opinionated Code Formatter

👉 Let's try: https://github.com/josephgoksu/prime-nestjs

--- 
My other blog posts:
- [Kubernetes on AWS EKS for Beginners(Part 1)](https://joeygoksu.com/software/kubernetes-on-aws-eks-for-beginners-part-1/)
- [Apache NiFi on AWS](https://joeygoksu.com/software/apache-nifi-on-aws/)
- [Using lottie animations in gatsby](https://joeygoksu.com/software/lottie-and-gatsby/)
- [Coding Criteria](https://joeygoksu.com/software/coding-criteria/)
- [AWS Amplify @auth directives](https://joeygoksu.com/software/aws-amplify-auth-directives/)
Idaesbasic - An all in one project manager
Tags: java, javafx, productivity, opensource
Published: 2021-11-06 20:33:15

# What is idaesbasic? 👋
There is a brand new project manager avaible, that runs offline, stores everything human readable and is open source. It's build with javafx and is called Idaesbasic, currently in beta version.

# Github 🆓
The Github repo of it is https://github.com/BenHerbst/idaesbasic

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

## What does it support / what will it support 🔨
It currently supports kanbans, calendars and todolists, and will support pomodoro timer, time tracking, news, emails, office, video calls, whiteboards and lot more things!

## How is it build? 😎
It's build with javafx, java and kotlin. You can download it as jar file, .exe, .deb or source code.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdu7u90ix2dkufygppnn.png) 

# Build with ❤️ - Idaesbasic!
An online shop API Node js
Tags: javascript, node, webdev, 100daysofcode
Published: 2021-11-06 20:22:35

onlineshop-api
An API for online store

Features:
Authentication
Products listing
Order placements

Technology Stack:
Node js
Express Js
MongoDB
JWT

Github : https://github.com/saidMounaim/onlineshop-api

Follow me on github : https://github.com/saidMounaim/
Why I'm studying this? - Web Applications Security, Part 1
Tags: security, beginners, network, webdev
Published: 2021-11-06 19:57:37

This and the followings texts will be part of my personal study about security for Web Applications. It represents a big challenge for me. For two reasons: First, because english is not my first language and I couldn't imagine to write a text in english at my life. And second, because security is a gap that I have at this exactly moment. And with this and others texts I want to win this two challenges and get enter in a beautiful and new world!

![A scene of the world destroyed. Grays sky, destroyed cars, and empty street](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kp1yv126unmow6lwl190.png)
 
Just kidding lol, let's move on!

## The importance of security and my shame

Security is an important them when we are building an information system, because in this kind of application we have private data going from a side to another. Then, it is not without importance (I know that must exists a better term for this) because in case of have our data stolen our users could be prejudiced and all the system would fall.

But unfortunately when we are building a product not always we are prioritizing build it considering that the best security practices is applied.

Last days I get interviewed and one of the questions was about security. In that time I see a lack of knowledge that I had in this topic. The question was very simple: "How you will store the password in database with security". And the only response that I gave was: "I could use md5 hash for store" HAHAHAHAHAHAHAHAHAHAHAH Jesus! What a shame!

This because in all projects that I've contributed the mechanism for security was granted by framework or by other then came before me and built it.

Then, when I got recovered from my shame feeling and put my self in the path of improving my security skills understanding from zero everything related to how to create secure RESTful APIs. I want to share my study path, bringing examples, sharing code and moving between theory and practice.

My initial point of study is a good text that I found at [restfulapi.net](https://restfulapi.net/security-essentials). In this text the author explore an overview about the topic, sharing Security Design Principles and Best Practices in a very broad vision.

I would like based on this text, understand better each principle and how to apply as well as show in the practice how to implement the best practices using my preferred languages (I need to decide what first 😰).

Then for now, I'm just introducing the method. If you need to have faster more info about the theme. Start reading the restfulapi.net, it seems a very useful introduction! But If you are interested in follow my path, read the text and come back here to follow with me, I will try to start writing the next asap, I swear!

UPDATE: Continue to the next part [here](https://dev.to/leofelicissimo/threats-driven-web-applications-security-part-2-1f7o)
How To Install Go on Ubuntu 20.04
Tags: go, ubuntu, programming, tutorial
Published: 2021-11-06 19:52:36

## Check Ubuntu version

First, run this command to make sure what version of Ubuntu you have:
```
lsb_release -a
```

Output example:
```
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename:	focal
```

## Install GoLang

Download the [latest](https://golang.org/dl/) GoLang archive: 
```
curl -OL https://golang.org/dl/go1.17.3.linux-amd64.tar.gz
```

Check SHA256 Checksum just in case:
```
sha256sum go1.17.3.linux-amd64.tar.gz
```

Extract everything to the `usr/local` directory:
```
sudo tar -C /usr/local -xvf go1.17.3.linux-amd64.tar.gz
```

Update `PATH` variable in `~/.profile` file:
```
sudo nano ~/.profile
```

Add new row with `export` at the end of the `~/.profile` file:
```
export PATH=$PATH:/usr/local/go/bin
```

Save the changes and exit `nano` editor. Now we have to refresh your profile. Run this command:
```
source ~/.profile
```

Installation and setup is done. Let's check if everything works.


## Make sure everything works

We will check Go version and create and run a simple program.

### Check the version

Run this command to check Go version:
```
go version
```

Output:
```
go version go1.17.3 linux/amd64
```

### Create and run 'Hello, World!'

Let's create a simple Go program and run it.

Create a directory and switch to it.
```
mkdir hello_go
cd hello_go
```

Now we have to create `go.mod` file with the `go mod init` command:
```
go mod init test/hello_go
```

Create a file where we'll write the program code in Go.
```
nano hello.go
```

Copy this example code to the file and save changes.
```
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
```
Save the changes and exit `nano` editor.

Run the program:
```
go run .
```

Output:
```
Hello, World!
```

Done!
How to raise to a degree in C++?
Published: 2021-11-06 19:27:36

To raise a number to a power in C++, it is enough to use the pow function, which is located in the math.h library.




The pow function takes two arguments: a number for exponentiation and an exponent of
double pow (double base, double exponent);

Sample code:

##include <cstdio>
#include <math.h>

using namespace std;

int main ()
{
printf ("%g",pow(3,5));
return 0;
}

The result of this program will be the output of the number 243, which is 3 to the 5th power.
Syncing my "htdocs"-folder between two computers?
Tags: php, webdev, beginners, workflow
Published: 2021-11-06 19:27:28

Hey guys.

I have an amazing laptop that I bring everywhere I go, in order to be able to jump into the coding whenever I get a fresh new idea.

I have been having some troubles lately, since I can't seem to find a liable way of syncing my "htdocs"-folder between to computers.

My Desktop-PC at home uses an Apache-server to host the website while it's in developement, and my laptop uses XAMPP to host the website.

I have been using a USB-storage device for moving and replacing the htdocs-folder each time I switch computers, but that just feels too wonky and old-school for me.

DO any of you guys have any experience with solutions for this? I thas to be rather affordable, as I am currently studying and working part-time. It also has to be reliable and easy to use.
I have thought of investing in a NAS-system to host the htdocs-folder on, but that does not seem to be the right thing to do..

Any input is appreciated.
Thanks!
- Frederick