teleren/devto huggingface dataset:
Best books for every software developer
Tags: webdev, programming, beginners, tutorial
Published: 2022-09-22 21:31:16

Any software developer worth their salt will tell you that one of the most important things you can do to improve your skills is to read.

But with the vast number of books available on the subject, it can be hard to know where to start.

To help you out, I’ve compiled a list of essential reads for any software developer.

Note: The list contains only books not related to any particular programming language.

1. Test Driven Development: By Example ( Kent Back )
 Another classic one.

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

[ Amazon link](https://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530?crid=2GI4T01NI7QUQ&keywords=Test+Driven+Development:+By+Example+(+Kent+Back+)&qid=1662899151&sprefix=test+driven+development+by+example+kent+back+,aps,216&sr=8-1&linkCode=sl1&tag=klitonbare-20&linkId=e6237ae0b440af30067b9ad0f1fca3cf&language=en_US&ref_=as_li_ss_tl)
 

I didn’t know a lot about TDD since I discovered it at a Codemotion event.

I’ve read this book multiple times, and since then, my code quality increased a lot.

Quite simply, test-driven development eliminates fear in application development.
 

In my opinion, this book should be a required read for anyone of any level and position in the software development field.

This book teaches so many timeless and solid principles that could take years for the average developer to learn, if ever, especially if you are a self-taught developer.

2. Cracking the Coding Interview, 6th Edition: 189 Programming Questions and Solutions

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

[ Amazon link](https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850?&linkCode=sl1&tag=klitonbare-20&linkId=be7481d97b5c1d44e8ce1fb115c89fb6&language=en_US&ref_=as_li_ss_tl)
Do- Want to crack all the codes thrown at you?

- You are not good at advanced techniques of coding?

-  
- This book is an excellent in-deep source for everybody who is preparing for an interview.

- You can’t just read it: you have to study and practice a lot.

This book is not only useful for preparing for an interview but also for sharpening your coding skills!

***Conclusion***
There are many ways to improve your development skills, and reading books is one of my favorites.

Pickup up a few of these titles and start reading. 📚

You won’t regret it!! 😃
Configure your browser's default tab size
Tags: css, browser
Published: 2022-09-22 21:29:04

---
title: Configure your browser's default tab size
published: true
description: 
tags: css, browser
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

I always used space for indentation. But lately I got convinced that tabs are better. So I switched to it for my new projects, enforced by Editor Config and Prettier.

My preference is one tab equals two spaces. But by default my browser's (Firefox) default tab size is 8. So I wanted to tweak it.

Unfortunately, I couldn't find a setting related to it. But I found the [CSS `tab-size` property](https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size). This property existence and good browsers compatibility means that if I can apply `tab-size: 2;` by default on all pages I visit, my preference will by applied.

To do that, I downloaded the [Stylus extension](https://addons.mozilla.org/fr/firefox/addon/styl-us/) and created a custom stylesheet with the following CSS code:

```css
body {
  tab-size: 2;
}
```

And voilà :tada:. Now I simply author my source code with tabs, my editor is configured to respect my preference for tab size and my browser also respects it. And every person that reads my code can also just set their tab size to their preferred value without me proclaiming "your should read it this way".

PS: please don't fight between spaces and tabs here. This post is not intended to elaborate on this question, but to help people looking for ways to configure their browser's default tab size.
Easily Deploying a Flask App w/ WayScript (for free)
Tags: python, webdev, wayscript, flask
Published: 2022-09-22 21:18:52

# In this tutorial, I am going to walk through the basics of setting up and deploying a flask app from scratch using [WayScript](https://wayscript.com) (a free deployment platform). 

## Step 1 - Create a WayScript project. 
WayScript projects are referred to as lairs, these are just flexible cloud based development environments for you to run and test your code. 

## Step 2 - Open up the code editor

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

Click on the **develop** tab to open your code editor on WayScript. In the editor, you have the following panels:
1. Editor
2. Terminal
3. Triggers
4. Processes

I'll cover some of these but for now make sure you have the `Editor` and `Terminal` views open (like in the image above).

## Step 3 - Install Flask
In the `Terminal`, input the following two commands: 
```
pip install flask
pip freeze > requirements.txt
```

## Step 4 - Setup Your Files
Now, we are going to add the first file for building your server. In the `Terminal`, type the following command: 
```
touch app.py
```
Once done, you should see the file `app.py` appear in the Code Editor. 

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

## Step 5 - Edit your `app.py` File
Here is the initial code for your app.py file:
```
from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def index():
    return {"Message" : "Hello World"}
```

## Step 6 - Set Up Your Deployment
In order to deploy your app, you need to configure an **deploy** Trigger. 

In your `Triggers` panel, select a Deploy trigger and fill in the following details: 
#### Command To Run: `flask run --port 8080 --host 0.0.0.0`
#### Port: `8080`

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

## Step 7 - Deploy your app!
Once the `Trigger` is set up, go the `Deploy` tab and press deploy! Now you app is good to go. You can view the app by referencing the URLs in your `Endpoints` tab. 

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

**Under endpoints, hit the prod url to see your endpoint working!**

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

**Note - in order to run your server in the dev mode, you must press the play button on the trigger you set up**

## Other Notes - Built in logs, processes, and alerts
There are other tabs for viewing logs, your server running, and you can set up automatic alerting if your app has any errors. 

Happy coding!
Yarn error: Configurando o arquivo yarnrc.yml para corrigir erro de instalação do Yarn
Tags: javascript, webdev, yarn, react
Published: 2022-09-22 21:03:35

Sim, deu ruim e o yarn não está mais instalando as depenências de um projeto na pasta node_modules. E quando tento rodar os comandos **Yarn**, dá pau.

Se você, como eu, já passou por isso, relaxa. Tem uma solução bem simples de ser executada.

-[Aprenda a usar ES6 no Node.js - simples e sem enrolação](https://medium.com/code-write/aprenda-a-usar-es6-no-node-js-simples-e-sem-enrolação-718e9816d0d5)
-[Criando uma api node.js na estrutura: Models - Services - Controllers - Routers](https://medium.com/code-write/criando-uma-api-node-js-na-estrutura-models-services-controllers-routers-907be9175cf4)

Então fica comigo que vamos ver:

- O que é **Yarn**;
- Como instalar o **Yarn**;
- Como iniciar um projeto com o **Yarn**;
- Como configurar para o **Yarn** instalar as dependências na pasta _node_modules_.

## O que é Yarn

O **Yarn** é um sistema de empacotamento de software desenvolvido em 2016 pelo Facebook para o ambiente de tempo de execução _JavaScript Node.js _(definição by Wikipédia).

Trazendo para o nosso mundo, o Yarn é um gerenciamento de pacotes. É similar ao NPM que já vem com a instalação do Node.js. Mas, ao meu ver, e no de muitos outros desenvolvedores, o **Yarn** trouxe mais elegância, praticidade, funcionalidades e vantagens em comparação ao _NPM_.

## Como instalar o Yarn

Para instalar o **Yarn** você precisa ter o _Node.js_ instalado na sua máquina. 

Tendo cumprido esse pré-requisito, basta escrever o comando abaixo no seu terminal (linux e mac) ou no prompt de comando (windows):

`npm install --global yarn`

ou

`npm i -G yarn`

Espero o script terminar de roda e pronto, você tem o **Yarn** instalado na sua máquina.

## Como iniciar um projeto com o Yarn

Iniciar um projeto com o Yarn é algo bem fácil. Basta digitar `yarn init` no terminal, e os arquivos iniciais serão criados no diretório do seu projeto.

Para adicionar dependências ao projeto com o Yarn, basta usar `yarn add` e o nome da dependência. Como, por exemplo, a instalação do Express:

`yarn add express`

Para startar um projeto com o Yarn, basta adicionar ao seu array de _scripts_ no arquivo _package.json_:

`"start": "node app.js"`

Vá ao terminal e digite yarn start. Logo em seguida seu projeto será startado.

## Como configurar para o Yarn instalar as dependências na pasta node_modules com o arquivo yarnrc.yml

Se você tiver qualquer tipo de problema para rodar algum script, delete a pasta _.yarn_. Vá à raiz do projeto e crie um arquivo _yarnrc.yml_. Neste arquivo, insira o conteúdo abaixo:

`nodeLinker: node-modules`

E pronto. Agora você pode reinstalar as dependências do projeto e usar seus scripts via linha de comando no terminal.

## Conclusão

Espero que esse artigo tenha te ajudado como me ajudou.

Se quiser conhecer outras configurações do arquivo _yarnrc.yml_, basta consultar a documentação oficial do **Yarn**.

Abraços e até a próxima.
Safeguarding Your Digital Assets
Tags: web3, cybersecurity, nft, devops
Published: 2022-09-22 21:02:01

### What and What not is possible to attackers!
 

This article is targeted at Web3 folks ranging from NFTS, DEFI and Degenz. I will list ways hackers can target your assets and ways you can position yourself to not fall in this traps.

- **Read before authorization or authentication:** Incase of interacting with contracts, discord authentication or minting a token. Always read what extensively on the access you are giving to the network.
If it includes dominant control of your wallet or anything asides the purpose of authentication you shouldn't proceed with that transaction and if you have done that already you can quickly go revoke access to your belongings.


- **Do not Interact with strange Token/NFT:** This is another way hackers can get control of your wallet.
This tokens/NFT stands as a backdoor and once interacted with in this sense, giving authorization to the malicious contract and the attacker now have access to your wallet.


- **Safeguard your SeedPhrase:** Your seedphrase is an access into your wallet and it shouldn't be saved on your device and if it must be; Take precautionary steps that will keep attackers away from your device.
1. Interact only with trusted links
2. Always Use a 2FA authentication
3. Avoid Pirate websites 
4. Avoid Popup updates as high percentage of popup updates are for malicious activities
5. Avoid public wifi
6. Plug only trusted cables or usb

And lastly always remember, if the good guys can do it, the bad guys can do it too
Be safe.
I learned much with FreeCodeCamp's " Basic JavaScript Course".
Published: 2022-09-22 20:54:38

> i just completed freecodecamp's "**Basic JavaScript Course**".
i learned so much in the enrollement of this course it was so exciting. Solving those problems made me look coding in a different way.

i can't wait to continue learning more ande more as time goes on.

_Here are some of the aspects of Javascript i learned from the course._

- Declaring,Storing and assigning Variables.
- Learn Basic Mathematical Operations.
- Working with strings and it's operations.
- Working with Arrays and Objects .
- Manupulating Arrays (push,pop,shift and unshift)
- if-else statements
- Looping(for,do-while and while loops)
- Recursion.
- Generating random values.

etc

thanks to everyone that supported me and helped me to be consistent.one step closer to my dream career.

**_We'll soon see the light at the end of the tunnel._**

-
On Switching From Ubuntu
Tags: linux, beginners, operatingsytems
Published: 2022-09-22 17:59:56

I started working through [The Odin Project's](https://www.theodinproject.com/) curriculum earlier this year (2022). In the earliest sections, we went through things like: choosing a text editor, setting up git, command-line basics, and most importantly, at least for me, getting started with Linux.

Ubuntu is the distro they recommended, and being new to it all, I was a little reluctant to give up Windows entirely. So I went through the process of configuring a dual-boot set-up with Windows alongside Ubuntu. Though not too long after, I made the switch entirely and gave up Windows once and for all.

I actually enjoyed setting it up though, learning how to dual-boot my machine, having to solve certain issues by searching on forums and reading about how other people solved the same problems I was having.

Being kind of privacy-minded, I eventually stumbled upon [Prism Break](https://prism-break.org/en/) a web site which offers good alternatives to the software offered by the mega-corporations.

From [Wikipedia](https://en.wikipedia.org/wiki/PRISM):
> PRISM is a code name for a program under which the United States National Security Agency (NSA) collects internet communications from various U.S. internet companies.

And so ever since reading bout how Ubuntu, and any derivative of Ubuntu, is NOT recommended by Prism Break, for [reasons](https://www.eff.org/deeplinks/2012/10/privacy-ubuntu-1210-amazon-ads-and-data-leaks), I decided to eventually switch Operating Systems.

And while I can see the appeal in "distro-hopping," as they say, it is kind of fun, it's also kind of a pain.

But so I went looking for a new OS. Trying to decide which OS I wanted to switch to, I considered a few: [Pop!_OS](https://pop.system76.com/), [Fedora](https://getfedora.org/), [Mint](https://linuxmint.com/), [FreeBSD](https://www.freebsd.org/). 

A couple weeks ago I finally made the switch. To [Debian](https://www.debian.org/).

The thing that sold me was their [philosophy](https://www.debian.org/intro/philosophy), and their [Social Contract](https://www.debian.org/social_contract) and while there are some downsides (Systemd, no non-free software, and software that's not always up to date), I'm happy with my choice.

Thank you for reading and have a great day! :)
First Pull Request
Tags: markdown, opensource, rust, html
Published: 2022-09-22 20:49:56

Starting the third week of **OSD600** and we find out that this time, it is not just overlooking someone else's code, but actually modifying it as well as adding some features. What we have to do during this lab is modify the file, so it is able to convert `md` file to `html` file as well. Also, we need to add one more feature for the md file conversion. It's more like a lab for us to help improve other people's program with actual code.

During this lab I managed to find a partner which was simple enough though there were  some unexpected complications. When I was doing my lab someone else had already filed an issue on my repository. So minor complications but nothing that we couldn't work around.

### During Contribution
The first step I did was I added an [issue to Eakam's repository](https://github.com/Eakam1007/rost_gen/pull/26) so that they knows what I'm doing with their code For this Lab 2, I'm going to implement the code that allows user covert a `md` file into a `html` file. Also, I would like add a feature that be able to change the header syntax (`#`) in an MD file  into the `<h1>random text</h1>`.

I then forked the [rost_gen repository] (https://github.com/LostButton/rost_gen) and started modifying the code. Though it did take me a while, because I had trouble understanding how to properly run the command. This is my first time coding and using **_Rust_** While coding it I accidently coded it twice meaning that there was a double output. But I fixed the issue shortly after. 

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

### Being Contributed To
Maxim was the one to contribute to my code, and it was honestly not that bad. The first time I've ever had a pull request, and it look like it went well for them. It was relatively minor changes, after that there wasn't need for much change besides the filename as well as some parts of `README.md`. Though instead of using GitHub to ask for him to change, I connected with them through **_Slack_** to ask for those changes.

### Thoughts
This was a relatively simple lab, that I had way too many issues with. This is due to the fact that this is the first time I have ever used **_Rust_**. This is the first time I have also created a pull request in order to **modify** someone else's code. It was an experience that was very welcome, and now is in my skill repertoire.

Link to my pull request: https://github.com/Eakam1007/rost_gen/pull/26
Link to the program I modified:https://github.com/Eakam1007/rost_gen

Link to pull request to my repo: https://github.com/LostButton/my-button-ssg/pull/7
Link to my repo: https://github.com/LostButton/my-button-ssg
HTML5 required and pattern are not a security feature
Tags: security, forms, javascript, developertools
Published: 2022-09-22 20:10:04

---
title: HTML5 required and pattern are not a security feature
published: true
description: using the required and/or pattern attribute on HTML input elements stops users from submitting forms with invalid values, but you can work around that using the Console tool
tags: security, forms, javascript, developertools 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifgk5x47c5odwah83c0g.png
canonical_url: https://christianheilmann.com/2022/09/22/quick-reminder-html5-required-and-pattern-are-not-a-security-feature/
# Use a ratio of 100:42 for best results.
---

In HTML5, you can provide a `required` attribute to ensure a certain field has been filled out before a form can be sent off.

```html
<input id="tac" required name="tac" type="checkbox">
<label for="tac">I have read the terms and conditions</label>
``` 
You can go even further and define a `pattern` that the value of the field needs to comply with before it can be sent off. For example, the following only allows entries that are either upper or lowercase a to z letters.

```html
<label for="pkey">Product key (A-Z only)</label>
<input id="pkey" required name="id" pattern="[a-z|A-Z]+">
```

You can read up more on [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern) and see some more examples.

Whilst this is an excellent way to get the browser to provide feedback to your users, it is not a security measure. Any form that relies on this feature alone can be defeated by using the [Developer Tools Console](https://learn.microsoft.com/microsoft-edge/devtools-guide-chromium/console/) and using JavaScript to submit the form. 

```javascript
$('form').submit()
```

You can see it here in action:

![Screen recording of a demo of a form preventing submission and Console working around it](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjo6l0lecjx7h5a6tfzt.gif)

In any case, you always need to check the validity of any incoming data on the server side and, if necessary sanitise the data.
Not Quite Lisp
Tags: adventofcode, algorithms, programming, javascript
Published: 2022-09-22 19:55:20

## [Advent of Code 2015 Day 1](https://adventofcode.com/2015/day/1)

## Part 1
### Ups and downs
- Where will Santa end up?
- What better way to find out than with `reduce()`!

My algorithm in JavaScript:
```js
input.split("").reduce(
  (floor, direction) => floor += direction == "(" ? 1 : -1
, 0)
```

## Part 1, a year ago
My algorithm in JavaScript:
```js
function dayOnePart1(str) {
  return str.split("").reduce((acc, curr, i) => { 
    return curr == "(" ? acc + 1 : acc - 1; 
  }, 0)
}
```
- Very similar to how I just did it
- Although the ternary feels awkward now that I'm familiar with putting assignment in the first clause

## Part 2
### Finding the first negative
My algorithm in JavaScript:
```js
let floor = 0, i = 0
while (floor !== -1) floor += input[i++] == "(" ? 1 : -1
return i
```

## Part 2, a year ago
My algorithm in JavaScript:
```js
function dayOnePart2(str) {
  let arr = str.split("")
  let firstBasement
  let acc = 0
  for (let i = 0; i < arr.length; i++) {
    if (acc == -1) {
      firstBasement = i
      break;
    }
    arr[i] == "(" ? acc += 1 : acc -= 1;
  }
  return firstBasement  
}
```

- A `for` loop with a `break` in it? Yikes!
- This feels so much more complicated!

## I did it!!
- I solved both parts!
- In three lines of code, each!
- Using syntax and techniques that I've grown much more familiar with throughout this experience!

## Year in review
- 46 stars earned: tied with my personal best!
- [2 simulators built](https://aocsimulators.rmion.repl.co/): tied with my lowest amount in a year!

![The Christmas tree almost all lit up](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qu4nz4ntavh9g3yfp644.png)

## Star count (2021-2015)
- 278/350: 79.4 - `C+` - Passing grade, still!
![Yearly star counts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/avyoze0sws19f07wtida.png)

## Last words, until December, 2022
I set out with one main goal:
- Attempt at least Part 1 of all 175 Days

I had other goals:
- Learn new computer science concepts
- Practice writing JavaScript
- [Practice Front-End Development by simulating highly-visual puzzles](https://aocsimulators.rmion.repl.co/)
- Teach beginners the joys of programming
- Document everything, especially frustrations, struggles, debugging, failed attempts, confusion and times that I cheated by resorting to any given Day's reddit Solution Megathread
- Surprise myself by solving tremendously difficult puzzles - at least for my professionally-untrained skill level
- Create a timeless series that, when discovered, can act as a silent partner along some other budding puzzle-solver's journey

Did I meet every goal? You bet!

Does this end here? Of course not!

This series will continue as long as [Eric Wastl](http://was.tl/) continues publishing more puzzles each December.

I encourage you to do like I did, and [support Eric](https://adventofcode.com/2021/support):
![Payment receipts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6bne5gbhy596xorycjn5.png)

See you back here in December, 2022!
Looking for a React Developer
Published: 2022-09-22 19:48:02

I am looking for a React Frontend Engineer.
Must have over 3 years of experience.
Love to see the best work in github.
This is contract based full time position.
Must have valid bank account ,as we will pay monthly salary based on invoice /tracked time in bank transfer.
Must be available in KL timezone , 1:00 PM to 6: 00 PM