teleren/devto huggingface dataset:
What Are Closures Anyway?
Tags: javascript, closures, scope, beginners
Published: 2020-02-23 20:29:58

During a breakup, closure is when you and your ex have accepted that your relationship with one another has come to an end. Both parties feel a sense of resolution that helps each other move on. In Javascript, closures are not that.

Let's take a look at the following function:

```js
const breakup = (name) => {
  const saying = " needs closure.";
  return name + saying;
};

console.log(breakup("Bonnie"));
// "Bonnie needs closure."
```

The function `breakup()` takes in a single argument and returns that argument + " needs closure.". `saying` is a *local* variable meaning it can only be used in the function where it is defined. It's inaccessible to other functions. Simple, right?

But a function can also access variables defined outside of a function:

```js
const saying = " needs closure.";

const breakup = (name) => {
  return name + saying;
};

console.log(breakup("Bonnie"));
// "Bonnie needs closure."
```

In this function, `saying` is now a *global* variable since it's defined outside of the function but still inside of its [lexical scope](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures). This is an example of a closure.

In more advanced and practical use cases, an inner function nested inside of an outer function can use closure in the same way. The inner function has access to the variables defined in the outer function. For now, just know that closures are any functions that use a variable from its parent scope!
What should I name my states for my XState state machine?
Tags: xstate, statemachines, fsm, javascript
Published: 2020-02-23 20:23:19

---
title: What should I name my states for my XState state machine?
published: true
description: Starting off new to designing a state machine can be daunting. Here's what I learned in terms of choosing what states I need and what to name them.
tags: xstate, state machines, fsm, javascript
---

I recently implemented [XState](https://xstate.js.org/docs/about/concepts.html) for a project that went to production. Thinking in terms of state machines was completely different from my usual way of writing programs.

Here are the lessons that I learned figuring out what states to choose and what to name them.

In general you should think of your application as what different states it's in **over time**. So lets look at the dictionary definition for the word state.

"the particular condition that someone or something is in at a specific time" - Oxford American Dictionary

So what are the different conditions that your application could be at a _specific time_? Look for both states that show _what's happening_ at the moment and _what happened_ in the past.

What you want to focus on, are the states that _change_ the behavior of your application. If that state doesn't the behavior of your application then you probably don't need to add it to your state machine.

Some examples of states:

* idle
* loading
* loaded
* inProgress
* selecting
* selected
* errored
* rejected
* draft
* published
* unpublished
* publishing
* loggingIn
* loggedIn
* loggingOut
* loggedOut

Once again, think about what condition your application is in over time. Put names to those.

Thinking about your application in this way, what states would you have? Comment below.
My AZ103 (Certification) Experience
Tags: microsoft, azure, certification, az103
Published: 2020-02-23 20:18:57


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

It's month 2 of the year 2020 and I have earned my second certification. I cracked my first - AZ900 (Microsoft Azure Fundamentals) in January followed by AZ103 (Azure Administrator Associate) last Friday. 

### Summary
All in all, I skipped no question (there are no negative marks). You need a score of 700 to pass, I scored 841 for AZ900 and 760 for AZ103. There's no way to know specifically which questions you failed and why, and there's also no way of knowing what the max score is. 

The one thing you are provided is a score report, with a graph that shows, out of 100%, the percentage of correct answers you got for a specific subject (VM Management, identity management, etc.).

### Exam Format
_As far as I have seen and read from various blogs there is no fixed number of questions that Microsoft sticks with, but it is around 45-55 and the number of a specific type of question(s) may vary from person to person_

I had a total of 47 questions in total, they included:

* 1 case study (i.e.: "Here's a business scenario with a bunch of requirements, and now answer these questions based on the provided information/requirements")

* Multiple-choice, with different types of questions, like:

  * Single-answer w/ multiple choice

  * Up to X answer w/ multiple choice

  * Fill-in-the-blank

  * Order the answers in the right order for what you need to achieve (with some answers that do not fit)

* __No Labs__. Yes, Azure has temporarily removed labs from AZ103 due to some issues. Every blog post and videos that I had checked had only bad things to say about the lab experience; that person had to go through during the exams. But even if they reintroduce labs, they are pretty straight forward and easy. 


### The Process
I spent around 2 weeks to prepare (for AZ103) and had a paid subscription for [Cloud Academy](https://cloudacademy.com/). I followed the learning path that they had specially curated for AZ103, along with the lecture courses it also includes Practice Labs, Challange Labs, and a Practice Test(which I failed horribly when I gave it for the first time). It was a hustle to cover all the topics within 2 weeks for me if you are new to the concepts I would suggest giving it more time. But then again depends on how quickly you can grasp the concepts. I spent around 3-4 hours on weekdays and close to 5 hours on weekends. 

### What Next
AZ400 (Maybe!) - An Admin or a Developer Badge is required (a prerequisite) to appear for AZ400, which means I am eligible. Yay! ;)
Share a thing you've been working on lately
Tags: watercooler
Published: 2020-02-23 19:19:07

---
title: Share a thing you've been working on lately
published: true
description: Don't keep it in the drawer - let the world see it!
tags: watercooler
---

What's something you've been building, researching or tinkering with lately?

It doesn't have to be prime-time ready, just share it here to get some encouragement from the community🤗
Make ✨ 🍰 ✨ requests act like jQuery when passing nested objects to data/payload
Tags: python, http, jquery
Published: 2020-02-23 19:11:37

## Once upon a time

I, once was stuck when using python-requests in order to poke a PHP backend.

You may currently face this issue as Requests does not support dict with depth greater than 1 on parameter data for a x-www-form-urlencoded based request.

PHP/jQuery $.params support this syntax out of the box. As requests is not about supporting the way PHP/jQuery $.params work internally, this PR maybe doomed.

## To reproduce

```python
from requests import post
from pprint import pprint

if __name__ == '__main__':

    response = post(
        'https://api.ipify.org?format=json',
        {
            'auth_user': 'test',
            'auth_pwd': 'test',
            'json_data': {
                'operation': 'core/get',
                'class': 'ServiceChange',
                'key': 'SELECT ServiceChange WHERE id=429',
                'output_fields': 'request_state',
                'h': {
                    't': 1
                }
            }
        }
    )

    pprint(
        response.request.body
    )

```

## What happen now

```python
print(response.request.body)
# auth_user=test&auth_pwd=test&json_data=operation&json_data=class&json_data=key&json_data=output_fields&json_data=h
```

Something should happen when passing nested dict. This behavior is wrong. We loss data between passing and sending. At least raise a warning or whatnot.

## ✨ What should have happened

```python
print(response.request.body)
# auth_user=test&auth_pwd=test&json_data%5Boperation%5D=core%2Fget&json_data%5Bclass%5D=ServiceChange&json_data%5Bkey%5D=SELECT+ServiceChange+WHERE+id%3D429&json_data%5Boutput_fields%5D=request_state&json_data%5Bh%5D%5Bt%5D=1
```

## Why ?

  - [x] `requests` is on a higher level than urllib, this does not make sense in `urllib`, but can in `requests`
  - [x] PHP and Ruby on Rails support this syntax out of the box, and is used by more than 30 % of the remote backends.
  - [x] This PR would make it more beginner friendly, advanced users that are looking for `test=foo&test=baz` are more likely to encode their payload manually. Not the other way around.
  - [x] This change does not break or change actual behavior expect for the multivalued param case which is a very rare case in my opinion. 


## How to use this patch ?

Simply use my fork for the time being, you could support my PR too.

Patch : [tree/patch-1](https://github.com/Ousret/requests/tree/patch-1)
PR : [https://github.com/psf/requests/pull/5253](https://github.com/psf/requests/pull/5253)
مِن أفضل ما أنتجه المحتوى العربي على الإنترنت… إليك هذه القائمة لتتابعها!
Published: 2020-02-23 19:01:49

أصبح تطبيق الــ DevOps ممكناً بدرجة كبيرة بسبب مجموعة الأدوات والممارسات الهندسية المرنة المعمول بها ولكن هذا ليس بكافي لتحقيق الفائدة المنشودة من DevOps. حتى مع أفضل الأدوات إذا لم تمتلك الثقافة الصحيحة اللازمة للتطبيق فتعتبر الــ DevOps مجرد كلمة رنانة!

السمة الأساسية لثقافة DevOps هي زيادة التعاون بين فريقي التطوير والتشغيل. وذلك عن طريق بعض التحولات الثقافية الهامة داخل الفرق نفسها وعلى المستوى الهيكل التنظيمي للشركة بشكل عام .



المسئولية المشتركة هي أهم جانب من جوانب ثقافة DevOps التي تشجع على توثيق التعاون.
DEV.to Widget v1.2.0🎉: GUI to create widget, new theme, data-sortby attribute and more! 
Tags: showdev, webdev
Published: 2020-02-23 18:56:18

Hello people! I just published the new version of DEV.to widget(v1.2.0). 

Now you can create your widget from GUI🎉!! 

Visit [dev-widget.netlify.com/create](https://dev-widget.netlify.com/create) and change the values!
[![Screenshot of GUI](https://dev-to-uploads.s3.amazonaws.com/i/mtozkkdt5eke2s99iamp.png)](https://dev-widget.netlify.com/create)


**Changelog**
- GUI!! [dev-widget.netlify.com/create](https://dev-widget.netlify.com/create)
- `data-sortby` attribute with `"reactions"` and `"date"` values.
- `data-contentheight="200px"` to change the height of the articles container.
- Bug fixes (Shoutout to @Pika1998 for finding and fixing a bug!)
- andd a new theme!! `data-theme="cobalt2"` (by @b3u, Thank you🌻)
![Preview of Cobalt2 Theme](https://dev-to-uploads.s3.amazonaws.com/i/w6sww4h0v4c1xu6t2qm1.png)


---

**Checkout dev-widget on GitHub**
{% github https://github.com/saurabhdaware/dev-widget no-readme %}

---

Thank you for reading!

Byeee 🐨🎉
GatsbyJS vs Jekyll ! What will you choose ?🤔
Tags: discuss, jekyll, gatsby
Published: 2020-02-23 18:43:04

Let share our opinion.
Personally I use Jekyll and love it. 😘

Jekyll inspired me to develope my own static site generator my_py_site(Python) and sudo_site(C++), both are featured on StaticGen.

Tell me about yourself.😁
Which one's your fav and why 😉 ?
Coding the Fortnite Item Shop in HTML & CSS in 1 hour (x5 speed) - video
Tags: tutorial, html, css, beginners
Published: 2020-02-23 18:34:09

*About the series: In this video series, I try to create high quality "clones" of existing UI's from scratch using web technologies. To make it more of a challenge, I set a goal of finishing the "clone" in 1 hour!*

In this video, I code the Fortnite Item Shop using html and css in 1 hour. 

{% youtube dqTENNRh9zs %}

Demo (Desktop only): https://bendy.dev/projects/clones/fortnite-item-shop
Code: https://github.com/bendygit/fortnite-item-shop
Website: https://bendy.dev

I hope you enjoy the video! I would really appreciate it if you subscribed. :)

Let me know what other UI's you would like to see me recreate in this format.
Go methods
Tags: go, beginners
Published: 2020-02-23 18:23:07

<a href="https://golang.org/">Go</a> does not have classes or object orientated programming in the traditional sense. But you can define methods on types.

In Go, a method is a function with a special receiver argument. For example, we define two methods like that (getX and getY):

```go
package main

import (
	"fmt"
)

type Coordinate struct {
	X, Y float64
}

func (v Coordinate) getX() float64 {
	return v.X
}

func (v Coordinate) getY() float64 {
	return v.Y
}

func main() {
	v := Coordinate{3, 4}
	fmt.Println(v.getX())
	fmt.Println(v.getY())
}
```

This outputs the x and y values of the struct.

```go
3
4

Program exited.
```

So on a programming level with Go, you might not miss OOP as <a href="https://golangr.com/struct/">structs</a> work just fine and you can apply methods.

A method can do more than just return a value. In the example below, the method Abs has a receiver of type Vertex named v.

```go
package main

import (
	"fmt"
	"math"
)

type Vertex struct {
	X, Y float64
}

func (v Vertex) Abs() float64 {
	return math.Sqrt(v.X*v.X + v.Y*v.Y)
}

func main() {
	v := Vertex{3, 4}
	fmt.Println(v.Abs())
}
```
GitKraken Glo Bloards y Timelines en el desarrollo de software
Tags: gitkraken, git, axosoft
Published: 2020-02-23 18:22:14

Si estás pensando en desarrollar software o ya te dedicas a esto es importante que conozcas sobre los sistemas de control de versiones para que los puedas aplicar en tus proyectos. En la actualidad se ha popularizado el uso de Git, por lo que cuenta con un sin número de clientes de interfaz gráfica, uno de ellos es [GitKraken](https://www.gitkraken.com) que te permite gestionar las versiones de tu programa de una manera fácil e intuitiva mediante una GUI (Graphical User Interface) muy depurada y con un gran conjunto de herramientas para gestionar tu proyecto.

En esta ocasión te voy a hablar de dos herramientas que incorpora GitKraken dentro de su repertorio para la gestión de proyectos de desarrollo de software.

**GitKraken Glo Boards**

Esta herramienta se basa en la gestión de tareas a través de la metodología de desarrollo ágil Kanban, las principales acciones que puedes realizar son:

 • Crear grupos de trabajo
 • Establecer etapas para la gestión del proyecto
 • Crear nuevas tareas y asignar responsables
 • Definir tiempos de entrega
 • Visualizar la actividad de cada usuario
 • Sincronización con herramientas de desarrollo como Visual Studio Code y Atom
 • Seguimiento del flujo de trabajo del equipo

![globoards](https://blog.axosoft.com/wp-content/uploads/2019/09/filter2.gif)

**GitKraken Timelines**

Esta herramienta fue desarrollada por [Axosoft](https://www.axosoft.com) con la finalidad de facilitar la visualización de tareas en una línea de tiempo. Además, fue pensada para trabajar en conjunto con GitKraken Glo Boards porque una vez creadas las tareas solo basta un clic para acceder a la vista de línea de tiempo, ordenada de acuerdo con los plazos que se hayan establecido. Las principales acciones que puedes realizar con esta herramienta son:

 • Crear múltiples líneas de tiempo
 • Agregar colaboradores a una línea de tiempo específica
 • Insertar imágenes o contenido embebido
 • Acceder a líneas de tiempo públicas
 • Combinar líneas de tiempo
 • Añadir enlaces o ítems en la línea de tiempo

![Timelines](https://blog.axosoft.com/wp-content/uploads/2019/12/overlay-75.gif)

Se puede mencionar que GitKraken posee una amplia gama de herramientas para el control de versiones, gestión de tareas dentro del equipo de trabajo y seguimiento del ciclo de desarrollo de software. Si deseas empezar con esta fabulosa herramienta te invito a descargarla de su página oficial

[https://www.gitkraken.com/download](https://www.gitkraken.com/download)

También te dejo algunos enlaces para que puedas profundizar tus conocimientos en el uso de Glo Boards y Timelines

[Glo Boards](https://www.gitkraken.com/glo)
[Timelines](https://www.gitkraken.com/timelines)
Coding the Google Search homepage in HTML & CSS in 40 minutes (x5 speed) - video
Tags: tutorial, html, css, beginners
Published: 2020-02-23 18:11:57

*About the series: In this video series, I try to create high quality "clones" of existing UI's from scratch using web technologies. To make it more of a challenge, I set a goal of finishing the "clone" in 1 hour!*

Back in October I started a series on youtube where I make a clone of a UI in a short period of time. The main reason I created this video series was because I thought it would be a good way to showcase the magic of coding to non-programmers, where you can build something out of nothing.

In this video, I code the google search homepage in 40 minutes.

{% youtube pwYc7vDDikU %}

Demo (Desktop only): https://bendy.dev/projects/clones/google-search
Code: https://github.com/bendygit/google-search
Website: https://bendy.dev

I hope you enjoy the video! I would really appreciate it if you subscribed. :)

Let me know what other UI's you would like to see me recreate in this format.
Let's Know Each Other? 
Tags: discuss
Published: 2020-02-23 18:08:49

I have been writing on DEV from the last 6 months and the support I have received from the community motivates me to write and share more.

I want to connect with more of you and learn from you. 

Here is my story :
---------
 
After completing my graduation in 2019, I started working on my startup, Frontbench. It was an education platform to help students of tier2/3 colleges get better mentorship and guidance. We felt that there is a gap between what these students are doing and what the industry requires. 

It was a unique experience for me to working on to solve such a problem.  However, due to lack of **Money**/**Patience** and **Persistence**, I QUIT. 

The learning, experience, and interactions I had during those few months are invaluable and it will definitely help in my future ventures. 

Currently, I am working as a software engineer at an early age startup in Gurgaon India building an e-commerce platform for automobiles products and services. 

My tech stack includes but not limited to  Javascript, ReactJS, NodeJS, MongoDB, PHP. 

I am aim to share my insights, learning, and tutorials here to my fellow community members.

Before that, it would be my pleasure to know about you and your work!

Let's get started! I am eagerly looking forward to hearing from you all. 

[Twitter](https://twitter.com/diipakkr)
Squid, a terminal for everyone
Tags: showdev, opensource, electron, typescript
Published: 2020-02-23 17:46:53

# Squid

**Squid** in an open-source electron terminal in developement.

Here is the GitHub repo, the code is documented so feel free to contribute :
[https://github.com/QuiiBz/squid](https://github.com/QuiiBz/squid)

## Screenshots
![](https://i.imgur.com/9t4kWi1.png)
![](https://i.imgur.com/KFY3Ezo.png)

## Features
- Choose the bash you want
- Create, delete, switch terminal tabs
- Create the theme you want
- Many settings like font size/family, cursor type...
- Auto-update

## Themes
There is a complete theme system which works with `.theme.json` files, located in `userData/Squid`. To apply a theme, edit the `currentTheme` key in `settings.squid.json` to match the theme name. Here is an exemple of a material theme :
```
{
  "name":"material",
  "background":"rgb(41, 45, 62)",
  "foreground":"#ECEFF1",
  "cursor":"#FFCC00",
  "black":"#000000",
  "red":"#E54B4B",
  "green":"#9ECE58",
  "yellow":"#FAED70",
  "blue":"#396FE2",
  "magenta":"#BB80B3",
  "cyan":"#2DDAFD",
  "white":"#d0d0d0",
  "lightBlack":"#6b6b6b",
  "lightRed":"#FF5370",
  "lightGreen":"#C3E88D",
  "lightYellow":"#FFCB6B",
  "lightBlue":"#82AAFF",
  "lightMagenta":"#C792EA",
  "lightCyan":"#89DDFF",
  "lightWhite":"#ffffff"
}
```

## Coming soon
- Plugins creation
- Hosts remember with
  - Quick SSH connect
  - Built-in SFTP
Why read Kent C. Dodds articles or newsletter
Tags: testing, watercooler
Published: 2020-02-23 17:36:27

TL;DR Short answer yes, [blogsite](https://kentcdodds.com/blog)

https://kentcdodds.com/blog/write-fewer-longer-tests
This blog incorporates many great concepts on testing tying together a lot of older articles Kent has written, a lot of them pertaining to React Testing Library (Kent created). 

I recommend a lot of things that Kent writes, even just following him on Twitter is has benefits. I personally enjoy writing tests, refactoring and debugging (I love features too don't get me wrong.)  Kent has insights and philosophies behind a lot of these things that I not only think are technically sound but agree with personally as well. Especially when it comes to things that have to do with testing, he has some of the best philosophies surrounding testing and Reacts Testing Library is built around these fundamental concepts.

These testing philosophies have even been adopted and encouraged by the React core team, stating in their documentation https://reactjs.org/docs/testing.html#tools

> React Testing Library is a set of helpers that let you test React components without relying on their implementation details. This approach makes refactoring a breeze and also nudges you towards best practices for accessibility. Although it doesn’t provide a way to “shallowly” render a component without its children, a test runner like Jest lets you do this by mocking.
eSign is a powerful library with fluent human readable syntax for the verification of files 
Tags: go
Published: 2020-02-23 17:35:53

Today I would like to present my first public github project.

[**eSign**](https://github.com/estatelabs/esign) is a powerful library with fluent human readable syntax for the verification of files according to the **SHA3-256 Bit** checksum and the digital signature **ed25519** written in GO. 

Currently the library is in beta phase. So the api might change.
The motivation behind the package was to share a reliable library for verifying files to trust them. 

I use this library in my own projects for my future own business, for verifying go plugins.

So I've said enough. Let's get started.

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

The code above shows the general usage of this library. There are some more supported things like base64 converting of signatures but in this article I only wanted to give you some impressions of it.

So I wish you happy coding 🥳 with it.

Feedback is welcome 🙏
Weekends project: Analytics for Open-Source communities
Tags: showdev
Published: 2020-02-23 17:23:54

---
title: Weekends project: Analytics for Open-Source communities
published: true
description: Listen & Engage Your Open-Source Community
tags: showdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/bcqhurvqfrhpzmbo5c5f.png
---

For those who don't know me, I am an [active open-source contributor](https://github.com/gajus). I spend a lot of time developing open-source projects and nurturing the community about them. To help me and others with open-source community management, I have built [GitSpo](https://gitspo.com/analytics) – an analytics and an outreach tool for open-source projects.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9tnzku2cigzdh0p8diov.gif)

It is pretty early in the days of the project, but I already integrate project mentions from GitHub, GitLab, Twitter, Reddit, Gitter, Hacker News, Medium, Stack Overflow, dev.to (of course! 😂) and a couple of other smaller websites.

The use cases are still emerging, but so far I have heard people wanting to use it to:

* track project mentions 👂
* track competition 👀
* measure project growth 🚀
* measure advertising campaign success 📈
* identify talent in the community 🧙‍♂️
* identify trends 💅
* talk to the community (more about this later!)

GitSpo is now live on [Product Hunt](https://www.producthunt.com/posts/gitspo-3) – please come see what others are saying about the project and share your ideas. (Investor? DM me!)