teleren/devto huggingface dataset:
A few tips for effective communication
Tags: productivity
Published: 2020-07-04 22:34:44

Are you feeling like you're sometimes wasting your time at work? Are people not answering to your messages on Slack? You're tired of all-hands meetings? Often, it does not take a huge investment into a new third-party platform to improve processes in your company. Simply improving the way you communicate can go a long way and provide immediate results. Thinking about the right words when you need something from someone else can completely change how you feel about your day-to-day activities.

Try out these strategies to communicate more efficiently with your coworkers:

-   Get to the point. Starting a conversation with nothing else but "Hi!" and waiting for the other to respond with a greeting before going further does not do much for you, does it?
-   Improve the "responsability" of your messages by asking a specific question. The recipient will be more likely to respond if you ask for their input directly and your question is focused.
-   Avoid sending messages to everybody unless it's an announcement. Only involve key persons in the conversation. Thinking about who you would like to talk to helps you understand better what you want to communicate about. Is your question related to project management, HR, or a specific application? If you don't know who the right person is, that's a great question in itself. An educated guess will be more fruitful that a message sent to all the members of a mailing list! If you really have no clue, ask a coworker or your supervisor. Make sure to take note of who your interlocutor is for future questions.
-   Nothing is more frustrating than a message saying "It's broken." and nothing else. Do your homework. You found a problem? Great! Don't expect others to solve it for you. If you found the answer by yourself, you will not even have to communicate about it. You won't have to wait for the person to free up time for you and you will learn something new.
-   Offer alternatives. What do you think the problem is? Have you researched possible solutions? What did you find? Did you examine the pros and cons? Are there other approaches you can adopt? People feel less frustrated and scared when you provide a plan B instead of ending the conversation with "That's not possible."
-   What is the next step? If your question necessitates a meeting, give two or three options for a time, day, and place. Make sure that you prepare before the meeting so that this time is focused on your question and nothing else. If you need some time to think about it or gather more information, tell your interlocutor when you will get back to them. In an hour? Tomorrow? Next week? Keep the conversation going. Make sure to follow up when you said you would.

Pro-tip: These principles also work in your personal life :)
Call For Contributors: Show Off and Improve Your CSS Skills!
Tags: webdev, css, news
Published: 2020-07-05 04:01:06

**Update**: 

⏰ Pre-launch submissions should be created as PRs into the main branch by Wednesday (7/8) evening so there's time to review and make adjustments.

✨ I'm looking at launching Style Stage at noon Friday (US Central time) via Twitch https://www.twitch.tv/5t3phdev

---

Modern CSS has features that so many of us have yet to fully explore. 

The replies here are a great reference:

{% twitter 1279169556800516096 %}

I author [ModernCSS.dev](https://modernCSS.dev) and have been thinking _a lot_ about many of these features. A couple days ago, that thinking led me to the following poll:

{% twitter 1278793338372657152 %}

> In 2003, [Dave Shea](http://daveshea.com/projects/zen/) began a legendary project called [CSS Zen Garden](http://www.csszengarden.com/) that provided a demonstration of "what can be accomplished through CSS-based design" until submissions stopped in 2013.

The positive response encouraged me to build out the concept for **Style Stage**.

I will be launching Style Stage in the next few days, so watch for the follow-up!

## Call for Contributors

I'm now seeking the first contributors!

Submitting your styles will involve a pull request to the project repo with a publicly available stylesheet URL, and your details including your name and optionally your website and twitter username. Full attribution will be retained with your submission.

Here are the draft guidelines with additional expectations and requirements:

{% gist https://gist.github.com/5t3ph/51185884aeab155e3f40aa4ec6f8b71a %}

**Interested**? Send a private message, and I will respond with the preview link on the evening of July 5 (I am in US Central time).

To be one of the first, you will need to be able to return a stylesheet by _Wednesday, July 8_. Later submissions will be delayed until after launch.
Resource for Web Development
Published: 2020-07-05 03:28:01

 
 Resources for learning html / CSS / JavaScript
 
  1. https://www.freecodecamp.org/learn 
  
  2. https://www.w3schools.com/default.asp
  
  3. scrimba - video and practice
  
  4. https://github.com/HackYourFuture/curriculum
  
  5. https://progate.com/courses
  
  6. https://www.youtube.com/c/JavaBrainsChannel/playlists
   
  7. Udemy
  
  8. Couresra
  
  9. https://www.faceprep.in/prograd/full-stack-developer/?source=Home
  
  10. Books
Did you know this JavaScript API?
Tags: webdev, beginners, javascript
Published: 2020-07-05 02:32:34


**JavaScript's** `onscroll` event is great, but how many of you have got bored of it trying to implement *Lazy Loading* or styling the *Navbar* on scroll while making a pixel perfect website? 

Telling the browser to constantly look for scroll changes might be bad for a site's performance cause the browser never stops looking for scroll changes. So what is the alternative?

This, right here:

**The Intersection Observer API**

This API is great for implementing the features such as Lazy Loading or Changing backgrounds on scroll. And this API is actually very easy to use without putting much effort and counting pixels.

**Here's how it works:**

**The Intersection Observer API** takes a single or multiple elements which of course you can iterate over each one of them, and it observes for it to intersect with the viewport. As soon as the element intersects with the viewport, the callback function is executed and the required task is done. Below is a demonstration showing how it works in action: 
**Scroll to see the changes:**

**Live Demo:**
https://zxcodes.github.io/JavaScript-Intersection-Observer-API/

**Link to the repo:**
{% github zxcodes/JavaScript-Intersection-Observer-API %}

Thanks for reading. Hope you like this. Have a great day!
Day 34 - #100DaysofCode - New/edit action versus create/update action
Tags: 100daysofcode, codenewbie
Published: 2020-07-05 01:50:00

When using CRUD and MVC something important to note is the difference to the new/edit action versus the create/update action. 

The difference is that a new and edit action simply renders a form. The create and update action handles the action of editing the database. The create action inserts data into the database and the update action will update the database. 

Simple concept, but as I practice creating routes in rails I realized how important knowing these concepts are when building an MVC/CRUD application.

{% youtube ztTGsRfiEjA %}
What do you love most about DEV?
Tags: devops, discuss, love, community
Published: 2020-07-05 01:20:00

I have to say after using or being a member of almost every platform that exists for developers, DEV is by far the most welcoming, respectful, polite and helpful community of developers online that genuinely help each other grow and learn from each other.

I am fascinated by how nice and pleasant everyone on this platform is, the moderators are cool and involved and the community is open to everyone irrelevant or  race or gender.

I am pointing out this last bit because of how shocked I was by my experience on stack overflow in the past 2 weeks, you can read about it more in this post i wrote here, I won't go too much into details. https://dev.to/scorpionedge/stack-overflow-has-become-an-unwelcome-and-hostile-platform-3mkd

The world needs more platforms for developers like this one, where no one is discouraged or discriminated for asking questions no matter what the question is. "There is no such thing as a stupid question", my professor once told me in college. Wise words. 
The best thing about DEV is that it encourages and breeds polite discussions and really does help us all grow and learn from each other. Isn't this the entire reason why we are all here in the first place?

What are your thoughts on this and please do share what you like most about DEV in the comments below.
Writing more Clojure docs in the future
Tags: career, clojure
Published: 2020-07-05 01:03:51

Whenever I start a project, I ask myself this question: "Am I bringing something new to the table." I'm trying to bring the same thought process to blogging. 

When I joined Dev.to in April, I came into the platform with the conviction that I would blog about Vue and React. Then I struggled - not because of a lack of interest or effect but because there were too many excellent articles in existence.  

What new thing would I bring to the table? Nothing. At the very least - junk. And at the very most (is that even a term), I would bring something that is highly derivative.

### So why Clojure?

Here's where Clojure comes into play. It's still incredibly niche, and there's not a lot of beginner friendly resources out there. My friend told me something funny the other day. 

> You know you're kind of a unicorn in the Clojure space because there are no junior Clojure developers. Every Clojure developer was a senior Java developer who slowly introduced Clojure at work.

Neither of us have the statistic, but it seems true. Most Clojure job postings I've seen have a pretty high bar, and most of them did use Java in the past.

Anyways, all of that to say that I am going to write more Clojure related blog posts because it's a language that's niche enough where I feel like I can actually contribute to its growth and popularity.

PS: Sometimes it's fun to take the road less taken, and that's why I started to learn Clojure.

Warmly,
DH
Show dev: `npx no-masters`
Tags: blm, showdev
Published: 2020-07-05 00:57:45

---
title: Show dev: `npx no-masters`
published: true
description: A one-line command to rename your master branch 
tags: #blm #showdev
//cover_image: https://direct_url_to_image.jpg
---

There has been a lot of talk recently on the topic of renaming the default git repository branch to something other than `master`.

I'm for it - and I made tool to make it easy:

# `npx no-masters`

will:

 - Create a copy of your `master` branch and rename it to `main`
 - (optionally) push this `main` branch to github and update the default branch
 - (optionally) delete the local and remote `master` branches
 - (optionally) set up your local git config to use `main` as the default branch when creating new repositories with `git init`.

Enjoy, and please share!

If you have (constructive) feedback or come across any issues, DM me on twitter [@typeof_goodidea](https://twitter.com/typeof_goodidea) or start an issue in the github repo: https://github.com/good-idea/no-masters
My 100 Days : Build websites using spreadsheets
Tags: programming, javascript, webdev, career
Published: 2020-07-05 00:30:32

SiteFromSheet my third side project , and [part of my 100 days](https://dev.to/hohooio823/my-100-days-from-scratch-into-getting-a-job-3fbi) journey toward getting a job . check out [live version](https://site-from-sheet.herokuapp.com/) and [source code](https://github.com/hohooio823/SiteFromSheet) .
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/acoymtycobjigube8sgr.png)
#**The idea :**
You can try it yourself with this [spreadsheet](https://docs.google.com/spreadsheets/d/13i1MUdywJoMvWHcrFoLT7eiBuosHlFKboFNgltvm96c/edit#gid=0) paste the link in my website.
Got inspired by [Andrey Azimov’s sheet2site](https://www.sheet2site.com/) , and tried to build my own version . The idea basically is a no code tool which use google’s spreadsheets for building websites .
#**The stack :**
Used express js and react js , and used [tableTop](https://github.com/jsoma/tabletop) to retrieve data from the spreadsheet .
#**How does it work :**
1- The spreadsheet’s link gets sent to the backend .
2- Getting the data out of the spreadsheet using tableTop.
```
[ { tag: 'title',
    value: 'Home Page'} ]
```
3- Mapping the Data and returning elements e.g :
```
if(ele.tag==='image'){
elements= [...elements,`<img class='row' src=${ele.value} />`]
}
if(ele.tag==='title'){
elements= [...elements,`<h1 class='row' >${ele.value}</h1>`]
}
```
##Previewing :
The elements array get sent to the front end , where is dangerouslySetInnerHTML to show the elements .
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xgn9iojdifb5od7jetm4.png)
##Downloading :
Creates an html file that includes html boilerplate + The elements , and sends the html file using res.sendFile .
#**How can you use it ?**
You paste the link to your spreadsheet and choose between previewing and downloading . Check out [The guide](https://github.com/hohooio823/SiteFromSheet) for more explanation .
#**What did i learn ?**
For the last two months , I’ve been writing code every single day for like 12 hrs or probably more . This period teached me some lessons :
1 - You won’t succeed in programming if you don’t enjoy programming .
2 - You never stop learning .
3 - You never know enough .
4 - The best way of learning is doing .
5 - Daily process even if not significant , makes significant impact .
follow me on [twitter](https://twitter.com/houssamasri)
My 100 Days : The challenge
Tags: javascript, sideprojects, career, react
Published: 2020-07-05 00:16:46

What challenge did i do? Check out the [live version](https://tictactoetic.herokuapp.com/) and the [source code](https://github.com/hohooio823/TicTacToe) of Tic Tac Toe .
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pxdrvxfu6bi17ksb98yn.png)
#**The story:**
I’m already doing [the 100 days challenge](https://dev.to/hohooio823/my-100-days-from-scratch-into-getting-a-job-3fbi) , With the goal of getting a job , in the same time to get the best out of myself and to do the best i can do . My first project is done , and now it is time for the second project which i wanted to be a challenge .
#**The challenge** :
The challenge was making the project afap with a deadline of a week . got the idea of making a tic tac toe since it seems a cool thing to make , and it has many parts and logic (means that it is good for showing the ability ) .
#**The game:**
##The stack :
For building the game i used react js and bootsrap .
## The logic :
first there is a square which is the big array every array inside is a row and every element inside is a column, it looks like this :
```
[['','',''],['','',''],['','','']]
```
When you play your turn , it looks like this e.g :
```
[['x','',''],['','',''],['','','']]
```
There is a function that detects the winner , the winner counter increase and a notification of who won is shown .
## Single Player mode :
i used math.random() to generate two number between 0 and 2 , the first number represents the row and the second represents the column . it checks if the element is empty if not it generates two numbers again .
#**The results :**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/eqmksxhh0rdvjt8uhfyf.png)
Made it in 5 days , it has two modes : single player and multi player . it shows you the winner and it has a counter for every player and for how many times each one of them won .
Follow me on [twitter](https://twitter.com/houssamasri)
Docker machine: what is and the main commands
Tags: docker, dockermachine, infrastructure, development
Published: 2020-07-05 00:09:22

Docker machine allows us to easily deploy an environment from a local machine in any infrastructure service, like AWS, DigitalOcean, Google Cloud, etc, through the installation of the driver that you want, environment variables, etc.

With that, we can create a host Docker in any of these platforms, and easily manage those machines from our local machine.

## Main commands

### CREATE

```bash
docker-machine create --driver virtualbox first-host-box
```

This command, creates a new host docker, with the driver VirtualBox and with the name "first-host-box".

### LS

```bash
docker-machine ls
```

Lists all the available hosts in your machine.

### ENV

Lists the environment variables that need to be set.

We can easily declare it with:

```bash
eval $(docker-machine env first-host-box)
```

### IP

```bash
docker-machine ip first-host-box
```

Lists the ip of the host docker.

### SSH

```bash
docker-machine ssh first-host-box
```

With this command, we can access via SSH this host docker and use Linux commands inside it.

### INSPECT

```bash
docker-machine inspect first-host-box
```

Shows details of the host docker.

### STOP

```bash
docker-machine stop first-host-box
```

Stops the host.

### START

```bash
docker-machine start first-host-box
```

Starts the host.

### RM

```bash
docker-machine rm first-host-box
```

Removes the host.

## Conclusion

With this, the Docker machine promotes great ease of installation and deployment in a cloud environment from its local containers.
python version change on mac
Published: 2020-07-04 23:57:27

###### To make links between files you need to use ln command. A symbolic link (also known as a soft link or symlink) consists of a special type of file that serves as a reference to another file or directory. Unix/Linux like operating systems often uses symbolic links. This guide explains how to use the ln command to create symbolic/soft links.##########

```shell
ln -s {source-filename} {symbolic-filename}
```
To change the version of python for your work, just do ;
```shell
ls -l /usr/local/bin/python* 
```
Once you have a list of versions select the version;
```shell
ln -s -f /usr/local/bin/python{version} /usr/local/bin/python
```
confirm the change of version with 
```shell
python --version
```
Docker machine: o que é e principais comandos
Tags: docker, dockermachine, infraestrutura, development
Published: 2020-07-04 23:55:26

A Docker machine possibilita deployar um ambiente de sua máquina local na infra que desejar, como AWS, DigitalOcean, Google Cloud etc, através da instalação do Driver que desejar, variáveis de ambiente e etc.

Com isso estamos criando um host Docker em uma máquina de uma uma dessas plataformas, e podemos facilmente gerenciar essas máquinas de nossa máquina local.

## Principais comandos

### CREATE

```bash
docker-machine create --driver virtualbox first-host-box
```

Com este comando, estamos criando um novo "host Docker", com o driver VirtualBox e dando o nome de "first-host-box".

### LS

```bash
docker-machine ls
```

Irá listar todos os hosts disponíveis em sua máquina.

### ENV

Irá listar todas as variáveis the ambiente que precisam ser configuradas.

Nós podemos facilmente declarar com o seguinte comando:

```bash
eval $(docker-machine env first-host-box)
```

### IP

```bash
docker-machine ip first-host-box
```

Lista todos os IPs do nosso host Docker.

### SSH

```bash
docker-machine ssh first-host-box
```

Com este comando podemos facilmente acessar via SSH nosso host Docker e executar comandos Linux dentro dele.

### INSPECT

```bash
docker-machine inspect first-host-box
```

Mostra alguns detalhes do host Docker.

### STOP

```bash
docker-machine stop first-host-box
```

Irá parar o host Docker.

### START

```bash
docker-machine start first-host-box
```

Irá iniciar o host Docker.

### RM

```bash
docker-machine rm first-host-box
```

Remove o host Docker.

Com isso, o Docker machine promove grande facilidade de instalação e deploy em um ambiente cloud a partir de seus containers locais.
Introduce C++ Lambda
Tags: cpp
Published: 2020-07-04 23:47:36

## Introduction
I will show three concepts of C++ Lambda in the blog post.
- Subroutine
- Capture by value
- Capture by reference

## Subroutine
We cannot define a routine in any existing routine.
```c++
void f(void) {
  int sum(int x, int y) {
    return x + y;
  }
}
```
So, we need the lambda expression. Let's rewrite the code as following.
```c++
void f(void) {
  auto sum = [](int x, int y) -> int {
    return x + y;
  };
}
```

## Capture by value
One of the C++ Lambda features calls Capture, here is the example usage.
```c++
void f(void) {
  auto sum = [s = 1](int x, int y) -> int {
    return (x + y) << s;
  };
}
```
As you can see it likes function parameters, it's the capture by value.

## Capture by reference
Typically, we have the **call-by-value** and **call-by-reference** in Computer Science. Just like that, we have the **capture by value** and **capture by reference** in C++.

```c++
void f(void) {
  auto s   = int(1);
  auto sum = [&](int x, int y) -> int {
    return (x + y) << s;
  };
}
```

The benefit of the capture by reference is that can avoid the coping overhead.

Thank you for reading, see you next time.
It's OK if your plans change
Tags: career, advice, codenewbie, motivation
Published: 2020-07-04 23:47:25

I received a Bachelor’s Degree in Economics. That’s the full extent of my formal academic history. During my undergrad, the career center asked me if I was interested in a PhD in economics. I said no. They asked me if I wanted to go on Wall St. I also said no. Then they asked me if I wanted to go to law school. I also said no. Four weeks later, I graduated and they stopped counseling me :(

Fast forward a year later, I became a data scientist in Oklahoma working for an energy company. Thereafter, I was designing graphics for newspapers which caught the interest of a large media company. I soon joined their design team in Toronto. I know. WTF, right (🤨)? Today, I am a software engineer at an investment bank.

My point is that with a little bit of time, I taught myself all the skills I needed along the way. I was not doomed because I studied economics, nor was I doomed because I decided to leave data science for graphic design. Any skills or credentials I possess are simply a reflection of what I chose to do with one chapter of my life. And because of how time works, they may slowly fade into the distance as I continue to write more chapters of my story (📚). 

How does your book read so far?

Warmly,
DH
DevTools inspected with DevTools
Tags: devtools, webdev, frontend
Published: 2020-07-04 23:26:15

---
cover_image: https://i.imgur.com/bh8AkIv.png
---

A lot of Chrome functionalities (settings, blank pages) are made with a bit of HTML and CSS. It is no different in the case of dev tools.

Follow the link below and open devtools: 
[devtools://devtools/bundled/devtools_app.html](devtools://devtools/bundled/devtools_app.html)

![meme](https://i.kym-cdn.com/entries/icons/original/000/023/397/C-658VsXoAo3ovC.jpg)

It's fun 😂
List to Tuple: a Little Compilation Optimization
Tags: python
Published: 2020-07-04 23:17:16

I was reading Julien Maury's [Python pro tips](https://dev.to/jmau111/python-pro-tips-27cb), and ran into this code snippet:

```
if myvar in [9,1,7]
```

I was about to leave a comment to suggest using a tuple instead, because instinctively you would think tuples should be faster than lists, right?

```
if myvar in (9,1,7)
```

And then I decided not to trust my instinct and take a look at the bytecode first. Well, what do you know... both code compiles to exactly the same:

```
0 LOAD_FAST                0 (myvar)
2 LOAD_CONST               1 ((9, 1, 7))
4 COMPARE_OP               6 (in)
```
So the compiler is smart enough to realize that even though I am creating a mutable list, I won't actually make any changes to it, and will use it only once, so it converts the list to a tuple.

Taking one step further, I changed the code to:
```
l = [9, 1, 7]
if myvar in l
```
Now the compiler creates a list:
```
0 LOAD_CONST               1 (9)
2 LOAD_CONST               2 (1)
4 LOAD_CONST               3 (7)
6 BUILD_LIST               3
8 STORE_FAST               1 (l)

10 LOAD_FAST                0 (myvar)
12 LOAD_FAST                1 (l)
14 COMPARE_OP               6 (in)
```
Although I suppose one could argue that in this case the compiler should still have detected that `l` is never changed, and converted it to a tuple.