teleren/devto huggingface dataset:
Small mistake to avoid as developer
Tags: beginners
Published: 2021-05-06 01:20:33


### Write code as sort as possible 
Don't write code too short because it's make other developers hard to understand, look at this code below
```js
‘?’ i = i ? i < 0 ? Math.max(0, len + i) : i : 0; 
```
Can you guessed value of variable I? If someone find this code he will spend his entire life just to find that variable i value is 0.  

### One letter variable
Don't name you variable with a, b, c or d, a short variable name because it's hard to find and search by editor, and even if we already found it we can't understand "the true meaning" of this variable until we analyze the code line by line.

### Use meaningless abbreviation
Don't name your variable with a meaningless abbreviation
```js
 list → lst
 begin_date →bgdt
 browser → bws
```
Instead of `dteofbrth` you can use `dob` as abbreviation of date of birth, it will help a lot in the future.

### Being abstract
Don't use abstract name such as `obj, value, data, elem` as your variable name unless it's is necessary, it's hard to define `data` variable if we use more than one data, and what is `data` or `value` mean either? everything has data and value

Instead you can use `userData` or `customerData` to define more meaningful variable name

### Super function 
Don't create a function that has many functionality, a good function only do one thing, `validateEmail(email)` function should only validate email format not to send or pre-fill email value, you can create other function to do that.

### Inconsistent
If you define `showFirstName` function to preview first name value then don't define `displayLastName` as function to preview last name value, it's confusing and hard to debug when our code is getting bigger, be consistent with your prefix

Instead of `displayLastName` you can define your function with `showLastName`, be consistent

### Use reusable name
Don't reuse a variable name that already set, because it's hard to know the actual value when we use it at multiple place
Visualizar autor, fecha y commit en una revisión de código
Published: 2021-05-06 01:18:18

Con la intención de mejorar la calidad de nuestros proyectos, muchas veces se revisará código de fechas anteriores y que no están en los actuales PRs de un repositorio, por lo que necesitamos conversar con el desarrollador que agrego esas líneas de código en ciertas funcionalidades. Ahora, con apoyo de este complemento "GitLens" podríamos saber en la línea de código que estemos ubicados, datos como: usuario de github, fecha, commit, entre otras interesantes funcionalidades, y así realizar las consultas respectivas.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m965p2jk4ewrexyaqde3.png)

Enlace: https://gitlens.amod.io/
https://marketplace.visualstudio.com/items...

También podemos ver comparativas entre commits, eso es muy útil porque sabemos los cambios en bloque que se hicieron y así nos queda más claro lo que se agrego determinada funcionalidad o refactorización.
Este complemento los usamos en el editor Visual Code.
Creando un mock server con Postman
Published: 2021-05-06 01:11:06

Cuando el backend no se encuentre listo todavía, es posible recurrir a postman a través de su servicio Mock Server.
Entonces primero debemos empezar por definir **¿Qué es un Mock Server?**Simplemente un servidor que provee datos de ejemplo para simular dependencias externas. 
Para poder crear nuestro mock server con postman necesitamos una creación de nuestra colección con un recurso.
Nuestro colección y recurso(el cual devuelve un listado de usuarios) se verían de la siguiente manera:
Api URL:http://api.example.com
Endpoint:http://api.example.com/Users
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v7kkh1ro86blfc32n18a.png)
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsq2t465xewwnbxi5uaa.png)
 
Como el backend todavía no está desarrollado, es necesario crear "examples" para nuestro recurso usuarios:

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

Ahora nos resta crear un mock server en postman;para ello vamos a nuestra colección, hacemos click sobre el ícono de los 3 puntos (…) y luego buscamos la opción **Mock Collection**.

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

Una vez creado nuestro mock server(debemos ponerle un nombre)nos aparecerá una pantalla, donde nos indicará la url de nuestro mock server, la cual debemos copiar.
Volviendo a nuestro recurso usuario,reemplazamos el url base  por la del mock server recién creado; presionamos Send y veremos que nos retorna la respuesta que definimos en el example anteriormente.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ywbfcwz89uf7eg2yx2gi.png)
Javascript's Strict Mode
Tags: javascript, beginners
Published: 2021-05-06 00:47:45

Some devs would probably describe javascript as a flexible language. Flexible, in this case, would refer to JS allowing certain lines of code that don't fall under 'proper syntax' to run without issue. I've often heard this action be referred to as failing silently. 'Strict mode' could be used to combat this flexible behavior in a lot of cases. You could think of strict mode as a sort of JavaScript compass, pointing you in the general direction of your error.

An example of not using strict mode vs. using strict mode could be seen with the variable assignment.  Not having strict mode while attempting to create a variable like this:

```
love = "Shovel Knight and Shield Knight" ;
love;
```

Would run with JS considering the love variable a global variable created with the var keyword. With 'strict mode' set at the beginning of the script that variable assignment would not be allowed and JS would throw a reference error, showing you where the mistake was made. 

```
'use strict' ;
love = "Shovel Knight and Shield Knight" ;
```

![shovel and shield](https://64.media.tumblr.com/f5ef4f6da11a6879a9dea05db20aa4f1/tumblr_n9yuz7pNjp1qh8rq6o2_500.gifv)

This would throw a reference error stating that love isn't defined. That error should let me know that I need to define the love variable with a keyword of either let or const. The var keyword can be considered as well but, for REASONS...... *ahem*, we will just stick with let and const. 

Since realizing this was an actual thing in JS, I've been trying to make use of it as much as I can. It's helped me to get better with my syntax and there's so much more that I can do than help you avoid bad variable assignments. Give it a try if you get a chance
Entrevista en SIN DIRECCION 🎙️ - sobre ser Ingeniera 👩🏽‍💻
Tags: interview, devjournal, ingeniera, podcast
Published: 2021-05-06 00:30:55

Hace un par de semanas, participé en esta entrevista con [Mike Mora](https://www.instagram.com/_mikemora/) en su podcast 🎙️ [Sin Dirección](https://www.instagram.com/sindireccion.mx/3)! 
Ha sido una entrevista un *tanto diferente*, a la académica/profesional, en las que he estado participante recientemente. Sinceramente, disfrute mucho conversando sobre temas de mi niñez "artística", reflexionar sobre mis decisiones para escoger estudiar una ingeniería, irme a estudiar al exterior, y volver a Bolivia para seguir trabajando con las comunidades y aportando en el desarrollo del país. Además de hablar un poco de **Inteligencia Artificial** 🤖 en nuestro mundo actual!

Les invito a escucharme jeje (esta un poco larga la entrevista, pero capaz la escuchan por partes!)

{% spotify spotify:episode:4do7DeU6GbK1MU9iAxjWOT %}
Useful Commands for Ubuntu
Tags: ubuntu, devops, webdev
Published: 2021-05-06 00:09:37

Following are the handy/useful list of commands & usage that we need from time to time.

## Table Of Contents
  * [Curl](#curl)
  * [Wget](#wget)
  * [Unzip](#unzip)

### Curl <a name="curl"></a>
* Download a remote file
```bash
curl -O [URL]
```
Or
```bash
curl –-remote-name [URL]
```
An example would be:
```bash
curl -O https://en-au.wordpress.org/latest-en_AU.zip
```
Or
```bash
curl –-remote-name https://en-au.wordpress.org/latest-en_AU.zip
```
* To save a remote file with a different name:
```bash
curl –O [FILENAME] [URL]
```
* Download multiple remote files
```bash
curl -O [URL1] -O [URL2]
```
* Download a remote file via FTP
```bash
curl -O [FTP_URL]
```
* Download remote files via FTP with credentials
```bash
curl -u [FTP_USER]:[FTP_PASSWORD] -O [FTP_URL]
```

### Wget <a name="wget"></a>
* Download a remote file
```bash
wget [URL]
```
* Download a remote file with a different name
```bash
wget -O [FILENAME] [URL]
```
* Download a remote file via FTP
```bash
wget [FTP_URL]
```
* Download files via FTP with credentials
```bash
wget -u [FTP_USER]:[FTP_PASSWORD] -O [FTP_URL]
```

### Unzip <a name="unzip"></a>
* Test if a zip file is valid file
```bash
unzip -t [ZIP_FILE_PATH]
```
An example would be:
```bash
unzip -t ./test.zip
```
* List contents of a zip file
```bash
unzip -l [ZIP_FILE_PATH]
```
* Extract a zip file
```bash
unzip [ZIP_FILE_PATH]
```
* Extract a zip file to a different location/directory
```bash
unzip [ZIP_FILE_PATH] –d [DESTINATION_DIRECTORY_PATH]
```
Pinball Machines, Amusement and Vending Equipment
Tags: pinball, stern, bally, william
Published: 2021-05-06 00:00:04

New And Used Pinball Machines And Arcade Games For Sale

pinball machine for sale l Buy branded Used Pinball online at affordable cost from The PinballMachineCenter.com with free shipping available for select machines! Shop Now!
https://bit.ly/3mgymyA


Unlimited Pinball Machine Fun! Everyone loves pinball machines, from those classic pinball games of yesteryear to the complex modern machines of today. Shop Now!

Stern Pinball Machines | The Pinball Machine Center

Stern Pinball Machines | Collectors can find the hottest Stern pinball machines for sale at The Pinball Machine Center, with free shipping available on select machines! Shop Now!
 

Buy Williams Pinball Machines | The Pinball Machine Center

Williams Pinball Machines | Collectors can find the hottest Williams pinball machines for sale at The Pinball Machine Center, with free shipping available on select machines!  Shop Now!

Buy Bally Pinball Machines | The Pinball Machine Center

Bally Pinball Machines | Collectors can find the hottest Stern pinball machines for sale at The Pinball Machine Center, with free shipping available on select machines! Shop Now!

Please feel free to contact us for any inquiries
•	crypted Email: Freedommerchant@protonmail.com
•	WhatsApp: +1 (929)-220-1498
•	Email: contact@pinballmachinecenter.com
•	Address: Los Angeles, CA
https://pinballmachinecenter.com
Postmortem Debugging in Python
Tags: python, debugging
Published: 2021-06-23 17:46:31

---
title: Postmortem Debugging in Python
published: true
date: 2021-05-06 00:00:00 UTC
tags: python, debugging
canonical_url: https://tech.serhatteker.com/post/2021-05/postmortem-debugging/
---

If you'd like to debug your code if *only* it throws an **uncaught** `exception` run:

```bash
$ python -m ipdb your_program.py
```

> **INFO**
> You can use default debugger — **pdb**, but I prefer **ipdb**.
>
> Install it with: `pip install ipdb`

If you don't provide the `-c` continue flag then you'll need to enter 'c' —continue, when execution begins. So it's better to use it with the flag:

```bash
$ python -m ipdb -c continue your_program.py
```

And since I use it a lot, I got an alias for it:

```bash
alias pd='python -m ipdb -c continue'
```


All done!
Real "senior devs" don't fix bugs in production
Tags: bugfix, meme, practices
Published: 2021-05-07 08:25:18

---
title: Real "senior devs" don't fix bugs in production
published: true
date: 2021-05-06 00:00:00 UTC
tags: bugfix,meme,practices
canonical_url: https://jhall.io/archive/2021/05/06/real-senior-devs-dont-fix-bugs-in-production/
---

There’s a good chance you’ve seen this video, or one like it, with the title “Senior developer fixing bug in production”:

[![](https://jhall.io/archive/images/senior-dev.jpg)](https://www.youtube.com/watch?v=aQHZ6LhPRzM)

And while these jokes do make me laugh, they also make me nervious.

_Real_ senior developers don’t fix bugs in production. _Real_ senior developers reproduce production bugs in their test environment, then they fix the bugs there under laberatory conditions before finally deploying fixes to production.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
stdout: Multi-module Python project using an __init__.py file
Published: 2021-06-20 17:47:08

---
title: stdout: Multi-module Python project using an __init__.py file
published: true
date: 2021-05-06 00:00:00 UTC
tags: 
canonical_url: https://nabeelvalley.netlify.app/stdout/2021/06-05/multi-module-python-projects/
---

When creating a multi-module project for Python, especially when coming from another language ecosystem, you may encounter issues importing code from other files, let's take a look at this

## The Modules

In our project, we've got the following files:

```
package1
  |- module1.py
package2
  |- namespace2
       |- module2.py
main.py

```

Let's say each of our modules export a function, here's the code for them:

`package1/module1.py`

```
def hello_p1_m1():
  return "hello"

```

`package2/subpackage1/module1.py`

```
def hello_p2_s1_m1():
  return "hello"

```

## The Main

Now that we've got our files with their functions separated, we try using them from the `main.py` file:

`main.py`

```
import package1.module1 as p1m1
import package2.namespace1.module1 as p2s1m1

print(p1m1.hello_p1_m1())
print(p2n1m1.hello_p2_s1_m1())

```

## The Error

Now, we try to run this using `python`:

```
python main.py

```

And we get the following error:

```
Traceback (most recent call last):
  File "main.py", line 1, in <module>
    import package1.module1 as p1m1
ImportError: No module named package1.module1

```

## The Solution

Now, this can be pretty annoying, but the solution is very simple. Python identifies a `module` as a single file, and the assumption that leads to the issue above is that we assume a `package` has the same convention of just being a directory

However, a `packgage` requires an ` __init__.py` file to be defined so that they are recognized correctly

So, we need to add two files:

- `package1/ __init__.py`
- `package2/subpackage1/ __init__.py`

Additionally, these files are completely empty, and only serve as information. Note that we don't need to include a file in `package2` directly as this directory does not contain any modules within it so is not really a package in itself and is simply a wrapper `subpackage1`
Coding Grace Irish Tech Newsletter is out (May Fourth)
Tags: irishdev, diversityintech, community, newsletter
Published: 2021-05-05 23:45:02

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bawqur9ezfq5e1pt3wqk.png)
 
Our latest newsletter is out and this post is to follow up on any events, announcements, CFPs, opportunities that came after the newsletter was published.

### [Read the Newsletter](https://mailchi.mp/4890ea5c46b1/cg21-may-news)

---
![updates](https://media.giphy.com/media/gF8jhb7lTPGzqzfZ0h/giphy.gif)
# Events
There's been some new Irish Tech events and Irish Diversity in Tech events added to the events listings since. Keep an eye out for the **new** label (I remove them after a few days after they are posted though). 
👉 https://irish-diversity-in-tech.netlify.app/events/

## Creative Coding Workshop
![imagiLabs Ireland promo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mw9s82ppoepgoy2ep45j.png)
A special announcement from our friends at [ImagiLabs](https://imagilabs.com), they are hosting an event as part of CodeWeekEU in Ireland on May 15.
> Learn the basics of Python with imagiLabs' creative coding tools! Perfect for kids ages 9-15, this 1.5 hour workshop for beginners will take coders from lighting up one pixel at a time to making colorful animations.

👉 https://codeweek.eu/view/361883/creative-coding-workshop
 
---

I'll be updating this post more this month. If you have other announcements, events, opportunities like grants or scholarships, please share in the comments below. Thanks in advance.
![coming soon](https://media.giphy.com/media/8FuLBRxtL7nwCchUcd/giphy.gif)
Introducing StewardX - Your automation buddy!
Tags: opensource, devops, rust, showdev
Published: 2021-05-05 22:45:18

Hey everyone! Long time no see.

## A little history

I was not active for couple of months but it was for a good cause. I've been learning Rust, and honestly, I fell in love with it! It's kinda low level but still gives one of the highest developer experiences while writing it.

Several months ago I've decided to create a useful side project - a dynamic price checker that supports multiple websites. But it didn't happen because I couldn't find the right tools I needed. That's why I've build **StewardX!**

## Introduction

### So what is [StewardX](https://stewardx.dev)?

StewardX is actually an acronym! It stands for **S**cheduled **T**ask **E**xecutor **W**ith **A**synchronous **R**untime and **D**atabase and an **X** on the end. It is a scheduled task executor. Think of cron but with a database. Being written in Rust, gives us a compiled, lightweight single file executable.

### Features
- It stores the outputs of tasks
- It can run tasks **periodically**
- It can be **triggered** to run tasks
- It supports both **Dockerfile** and **Docker image (prebuilt)**
- It supports **command tasks** (like echo "Hey")
- It serializes and saves tasks in **Database** (Currently only PostgreSQL).
- Got a buggy and cute control panel 😛

I'd like to point out the last item, it stores tasks in database! Means that, it's portable :grin:

### Task types
StewardX currently supports two task 
- Docker - As I said, it supports both dockerfiles and docker images
- Command

But it can be easily extended, thanks to Rust's trait system. In fact, I'll be writing tutorials to explain how to add a new task type.

### Frequency
Currently, there are two frequency types:
- Hook - *which is basically a webhook*
- Cron - with seconds support


I'll be writing more tutorials and guides about StewardX, but in the mean time, feel free to checkout the [repository](https://github.com/gokayokyay/stewardx) and the [documentation](https://stewardx.dev).

See you!
4 things to help you learn how to code fast
Tags: codenewbie, firstpost, 100daysofcode
Published: 2021-05-05 22:26:39

If you're looking for a fast way to learn how to code. You need to know these 4 things:


1. Mentorship: It will help you get through any questions you may have.

2. Personal Projects: It helps you to be passionate about what you're learning.

3. Daily challenges: It helps you sharpen your skills with a new problem to solve every day.

4. 2 - 4 hours a day to dedicate to coding a minimum. You stay consistent that way every single day.
Windows vs Linux
Tags: linux, windows, os, programming
Published: 2021-05-05 22:24:18

Windows is like a Game Boy. You go to the store and buy one all shiny new in the box. You take it home, turn it on, and play with it. Pretty graphics, cute sounds. After a while, though, you get tired of the game that came with it, so you go back to the store and buy another one. This cycle repeats over and over. 

Finally, you go back to the store and say to the person behind the counter, “I want a game that does this!” only to be told that no such game exists because there is no “market demand” for it. Then you say, “But I only need to change this one thing!” The person behind the counter says you can’t change it. The games are all sealed up in their cartridges. You discover that your toy is limited to the games others have decided that you need.

Linux, on the other hand, is like the world’s largest Erector Set. You open it, and it’s just a huge collection of parts. There’s a lot of steel struts, screws, nuts, gears, pulleys, motors, and a few suggestions on what to build. So, you start to play with it. You build one of the suggestions and then another. 

After a while you discover that you have your own ideas of what to make. You don’t ever have to go back to the store, as you already have everything you need. The Erector Set takes on the shape of your imagination. It does what you want. Your choice of toys is, of course, a personal thing, so which toy would you find more satisfying?
🆔 Identity, Unlocked... Explained: Season 2, Ep 6
Tags: security, identity, podcast
Published: 2021-05-05 22:12:05

## The Overview

In this episode of Identity, Unlocked, principal architect at Auth0 and podcast host Vittorio Bertocci focuses on OpenID foundation’s FastFederation (FastFed) group. Vittorio chats with Darin McAdams, a software engineer at AWS and the author of FastFed’s specifications, to explore how FastFed is looking to shorten the time it takes to join organizations into a federation.

Darin explains that Dick Hardt, one of the founders of FastFed, zeroed in on him to edit and draft the spec for FastFed. Darin began at the beginning, creating a sample G Suite and trying to set up a federation between both AWS and Salesforce. When he finally arrived at a place to begin joining the orgs, he was stuck - the first line, the first page, the needle scratches, and he doesn’t know how to proceed.

Eventually, after reading the SAML specs and following Google’s directions for integration, a long drawn out process of over 40 steps, Darin was finally able to integrate his sample G Suite with AWS, but never Salesforce. It became clear to him this process could be made much faster through automation.

FastFed is going after integrating a push-button single-sign-on experience for users of a federation, and to do so, they have to develop the communication between different authentication programs used by the organizations. FastFed also runs into the complications of communicating between identity providers, enterprise security preferences, and creating trust between the orgs.

Darin and Vittorio dive into more details of the problems faced creating FastFed and scaling down a program with a vast scope into a push-button user experience.

[Read more...](https://auth0.com/blog/identity-unlocked-explained-season-2-ep-6/?utm_source=content_synd&utm_medium=sc&utm_campaign=identity_unlocked)