teleren/devto huggingface dataset:
SELECT Post FROM Stack Overflow Questions WHERE Topic = "git" ORDER BY Votes DESC;
Tags: stackoverflow, discuss, git
Published: 2019-08-30 15:39:36

Recently, one of my friends, [Jamie Hall](https://twitter.com/jamie_hall), wrote a really great, practical tutorial titled ["Get good at git"](https://jamiehall.cc/2019/08/17/get-good-at-git/). In it, he introduces the basic workflows you need to know to use the version control system everyone "loves to be hated by" (his joke, not mine). Not only is it a lovely introduction to git, this paragraph really resonated with me:

> In practice, everyone [screws] up constantly. I’m talking about professional software engineers, with many years’ experience, totally [screwing] up their work through unforced errors and dumb mistakes.

Problems with git are so common that [Katie Sylor-Miller](https://twitter.com/ksylor) [created a website](https://ohshitgit.com/) explaining how to get out of a specific git mess in plain English.

Knowing that the best place to find reassuring company with other developers totally screwing things up is Stack Overflow, I decided to have a look at the [all-time top questions by votes](https://data.stackexchange.com/stackoverflow/query/36657/most-upvoted-questions) to see how common git problems are. And it turns out that **5 of the top 10 most voted questions are about getting help with git**.

If you've come across one of these questions (I know I have), you are very far from alone! I used [DEV's new Stack Overflow liquid tag](https://dev.to/devteam/changelog-stack-overflow-liquid-tag-12o2) to embed the top git questions of all-time on Stack Overflow. Plus, on Stack Overflow you can now also [click "share" and select "DEV" on any post](https://dev.to/devteam/native-share-to-dev-button-is-now-on-stack-overflow-3a5a).

## #2 most upvoted question

{% stackoverflow 927358 %}

## #3 most upvoted question

{% stackoverflow 2003505 %}

## #4 most upvoted question

{% stackoverflow 292357 %}

## #8 most upvoted question

{% stackoverflow 348170 %}

## #9 most upvoted question

{% stackoverflow 6591213 %}

## What about you?

Are there Stack Overflow questions about git you constantly reference? What are your biggest git hangups? Have you ever had any "oh crap" moments with git?
Code Story E5: Alvaro Sabido on Switching Gears
Tags: podcast, codestory
Published: 2019-08-30 15:37:08

{% youtube t05EoYq9RF4 %}

A born creative, Alvaro Sabido loves to travel and continuously be learning. His engineering background led him to love anything with an engine, and having worked in a diverse set of companies through consulting, IT, radio and media, he became a natural problem solver, interested in innovating to make things better.  When seeing a picture of someone in the military holding a book up to a webcam, attempting to read to their child back home, he set out to create a solution to integrate a video chat and a children’s book – and what would eventually be called Caribu. Want to support Caribu? Check out their fundraising campaign on WeFunder (https://wefunder.com/caribu).

In the clip above, Alvaro Sabido discusses how he ended up switching gears and wasn't initially interested in video chatting. If you like what you hear, check out the full episode below.

{% podcast https://dev.to/codestorypodcast/e5-alvaro-sabido-caribu %}
Hack The Box invite code challenge!Its time to begin hack.
Tags: python, linux, javascript, challenge
Published: 2019-08-30 15:36:07

**Its an open challenge for all dev.to programmers & hackers hack the invite code of Hackthebox ,play with this explain your tools & tricks in comment box ~Thankyou.** 

**Hackthebox*** is An online platform to test and advance your skills in penetration testing and cyber security. Join today and start training in our online labs.If you want learn ore about **pentesting,hacking** so **hackthebox** is one of the best online platform for all beginner's.
But wait Let's talk the fun part to start working on the hackthebox first of all you need to hack it,means you need to get the invite code of this super platform.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/6k48fwa5bm6r594d1m1u.JPG)

I have explained my methods for this challenge below!
##**My Tools and tricks to hack the invite code of hackthebox:**

### My First Method:
-> Tools:
   - chrome devtools
   - Burpsuit
   - curl
   - base64

### My Second Method:
-> Tools:
   - chrome devtools
   - curl

-> Scripting:
   - Javascript
   - Python script

**My Python Script to hack the hackthebox invite code:**
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/udnne9jqzu8216u4oe3n.JPG)
https://gist.github.com/ankitdobhal/c6ef926cd943383a5ada4a0a8e47fd8c
<script src="https://gist.github.com/ankitdobhal/eb3cfcc395c715b0f3c5e6934fe34171.js"></script>
So after using curl I found the encrypted message of code and decode the message using my python script.To decrypt the code I used base64 python library and sys library for passing command line arguments.
-> import sys
-> import base64
The [Script](https://gist.github.com/ankitdobhal/c6ef926cd943383a5ada4a0a8e47fd8c) is avalibale in my github account.`**Thankyou** 
So its a challenge explain your tools & tricks in comment section Hope we will do something amazing with this challenge.
Code Story E5: Alvaro Sabido on Team Culture
Tags: podcast, codestory
Published: 2019-08-30 15:31:25

{% youtube lm720ovM_oo %}

A born creative, Alvaro Sabido loves to travel and continuously be learning. His engineering background led him to love anything with an engine, and having worked in a diverse set of companies through consulting, IT, radio and media, he became a natural problem solver, interested in innovating to make things better.  When seeing a picture of someone in the military holding a book up to a webcam, attempting to read to their child back home, he set out to create a solution to integrate a video chat and a children’s book – and what would eventually be called Caribu. Want to support Caribu? Check out their fundraising campaign on WeFunder (https://wefunder.com/caribu).

In the clip above, Alvaro Sabido talks about the culture at Caribu and what it's like to work there. If you like what you hear, check out the full episode below.

{% podcast https://dev.to/codestorypodcast/e5-alvaro-sabido-caribu %}
Code Story E5: Alvaro Sabido on Building the Caribu Team
Tags: podcast, codestory
Published: 2019-08-30 15:31:13

{% youtube kinolxRboaw %}

A born creative, Alvaro Sabido loves to travel and continuously be learning. His engineering background led him to love anything with an engine, and having worked in a diverse set of companies through consulting, IT, radio and media, he became a natural problem solver, interested in innovating to make things better.  When seeing a picture of someone in the military holding a book up to a webcam, attempting to read to their child back home, he set out to create a solution to integrate a video chat and a children’s book – and what would eventually be called Caribu. Want to support Caribu? Check out their fundraising campaign on WeFunder (https://wefunder.com/caribu).

In the clip above, Alvaro Sabido talks about what it was like building the team at Caribu. If you like what you hear, check out the full episode below.

{% podcast https://dev.to/codestorypodcast/e5-alvaro-sabido-caribu %}
NodeJS: How To Send An Email
Tags: javascript, node, eli5
Published: 2019-08-30 15:05:00

---
title: NodeJS: How To Send An Email
published: true
description: NodeJS: How To Send An Email
tags: javascript, node, eli5
series: Intro to NodeJS
---

## Intro

So we [installed NodeJS](https://dev.to/miku86/what-is-nodejs-how-to-install-it-1900) on our machine.

We also know [How to Get External Packages](https://dev.to/miku86/nodejs-how-to-get-external-packages-npm-56oj).

Now we want to learn how to send an email using [nodemailer](https://www.npmjs.com/package/nodemailer).

## Write a simple script

- Open your terminal
- Create a file named `index.js`:

```sh
touch index.js
```

- Add this JavaScript code into it:

```js
// import nodemailer (after npm install nodemailer)
const nodemailer = require('nodemailer');

// config for mailserver and mail, input your data
const config = {
  mailserver: {
    host: 'smtp.ethereal.email',
    port: 587,
    secure: false,
    auth: {
      user: 'yutfggtgifd7ixet@ethereal.email',
      pass: 'tX29P4QNadD7kAG7x5'
    }
  },
  mail: {
    from: 'foo@example.com',
    to: 'bar@example.com',
    subject: 'Hey',
    text: 'Testing Nodemailer'
  }
};

const sendMail = async ({ mailserver, mail }) => {
  // create a nodemailer transporter using smtp
  let transporter = nodemailer.createTransport(mailserver);

  // send mail using transporter
  let info = await transporter.sendMail(mail);

  console.log(`Preview: ${nodemailer.getTestMessageUrl(info)}`);
};

sendMail(config).catch(console.error);
```

Note: Nodemailer has a lot of available settings, therefore read [the docs of nodemailer](https://nodemailer.com).

---

## Run it from the terminal

- Run it: 

```sh
node index.js
```

- Result: 

```sh
Preview: https://ethereal.email/message/XWk2jZDkEStePsCvXWk60Yf74VUAhgNZAAAACQqQo2lpzFsxaciWAqd9ZjY
```

---

## Further Reading

- [nodemailer on npm](https://www.npmjs.com/package/nodemailer)
- [nodemailer docs](https://nodemailer.com)
- [config mailserver](https://nodemailer.com/smtp)
- [config mail](https://nodemailer.com/message)



---

## Questions

- What is your favorite way/package to send mails in Node?
- Do you automate some tasks with node emails?
Check and assign value or just assign value?
Published: 2019-08-30 14:59:04

Sometimes there is a need to set some flag if one of the items in the collection satisfies a condition. It is usually done in the loop of some kind, like this:
<code>
<pre>
let hasEdibleBananas = false;

bananas.forEach(banana => {

  // ... do some banana related stuff here

  if (banana.isYellow) {
      hasEdibleBananas = true;
  } 
})
</pre>
</code>
This code works, but we reassign value to *hasEdibleBananas* multiple times in case there is more than 1 yellow banana.
We could add another condition that checks if *hasEdibleBananas* is already set before assigning a value to it:
<code>
<pre>
let hasEdibleBananas = false;

bananas.forEach(banana => {

  // ... do some banana related stuff here

  if (banana.isYellow && !hasEdibleBananas) {
      hasEdibleBananas = true;
  } 
})
</pre>
</code>
My question is, whether there is really a need for checking if the *hasEdibleBananas* flag is set before setting it.
As far as I know, there should not be any perceivable performance benefit in the second case - when we perform additional check, neither do I think that the code is more or less readable in either of the cases. In fact, some could say that adding another condition that doesn't make any difference from the functionality point of view adds unnecessary noise to the code and thus makes it less readable.

What do you think?
Sketchy Pseudo-3D Switch Checkbox
Tags: codepen, vue, design, uiweekly
Published: 2019-08-30 14:58:55

<p>VueJS component for switch checkbox.</p>

<p>Designed to look like a hand-sketched flat-style ui element, a little bit 3d and animations (or should I say transition).</p>

<p>I just used the "+" selector for CSS to do the active and inactive state of the button.</p>

<p>I just used the VueJS for the component, so that I only need to call the "switch" tag.</p>

<p>Although I only put the name as the attribute. I think, I also need to put the event attributes.</p>

<p>To see the technique how I did the active state in CSS, please refer to the link below, and scroll down to "Solution number 3".</p>

[Styling Checkbox](https://dev.to/takaneichinose/styling-checkbox-history-that-i-know-evolution-of-my-knowledge-3l)

{% codepen https://codepen.io/takaneichinose/pen/wvwqBdM %}
Native "Share to DEV" button is now on Stack Overflow
Tags: meta, stackoverflow
Published: 2019-08-30 14:51:53

If you click the `share` link on Stack Overflow you now see three options where there were once only two.

If you click the `DEV` icon, you'll be brought to a DEV editor with a prefilled Stack Overflow liquid tag to make sharing questions and answers more easily within this community.

You may do so in order to share a helpful tip, enrich a tutorial, or editorialize or host a "meta" discussion about the Stack Overflow content. With a much looser format than Stack Overflow itself, feel free to have sprawling conversations.

This feature was made possible by two features recently shipped on DEV:

{% link https://dev.to/devteam/changelog-stack-overflow-liquid-tag-12o2 %}

{% link https://dev.to/devteam/announcing-off-platform-share-to-dev-functionality-57j9 %}

Let's use this functionality to help bring light to all the most important questions:

{% stackoverflow 245062 %}

CodePen, Replit, and now Stack Overflow all have Share-to-DEV buttons. GitHub, will you be next?

_Note, at the moment this is only live on the desktop version of the site, not mobile._

Happy coding!
Introduction to kotlin section1
Tags: kotlin, android, programming
Published: 2019-08-30 13:45:51

Hello guys, so i decided to start the kotlin series and today i'll be giving you an introductory class to it.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/8e8pic0bkat3dec3ftfl.jpeg)

History of kotlin

• First appeared in 2011, Current stable release 1.3.41.

• On Feb 2012, open sourced.

• Kotlin v1.0 was released on 15 February 2016.

• At Google I/O 2017, Google announced first-class
support for Kotlin onAndroid.

• Kotlin v1.2 was released on 28 November 2017.
Sharing code between JVM and Javascript.

• On May 7 2019, Google announced Kotlin as a first
preferred language for Android app developers.



What is kotlin?

“Kotlin is a new programming language targeting JVM, Android

and even JavaScript.”

1. Modern and Statically typed

2. Interoperable with java 100%

3. Works anywhere java does

4. Targets Native, Javascript, JVM and Android 

5. Object oriented and also a functional language too

6. Open source

7. Developed by Jetbrains( yea the geeks who build our loveable Android studio).

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/kw1s6kbbfsoef6zz0p6u.png)

What's kotlin about?

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/tmbkxbuvh98o72n19b7b.png)

Why kotlin?

• It is a fun language and costs nothing to adopt.

• Tired of Java, JavaScript ? Concise language.

• Helps you to be more productive. No runtime
overheads.

• Everywhere

• Push from Google and Android community.

• Cool language features.

• Functional Nature. Solves nullability problem



KotlinEveryWhere( kotlin's usage)

• Android Developers (JVM)

• Backend Developers (JVM)

• IOS Developers (LLVM) - Haven't seen this in action though

• Windows Developer (LLVM) - Haven't seen this in action either

• Javascript Developers 

Well we will stop here today and brace yourself for another section(Kotlin basics).Thank you..

Drop comments if any and don't forget to share.
Login best practices
Tags: help, discuss, php
Published: 2019-08-30 14:45:03

Wanting a bit of advice regarding logging in using php and mysql.

The general flow is after validating data etc:

`SELECT username, password FROM users WHERE username = $_POST['username'];`

Then using `password_verify()` to check if the hashes match.

The question is if it is better to just query for the username first e.g.

`SELECT username FROM users WHERE username = $_POST['username'];`

If that yields a result then:

`SELECT password FROM users WHERE username = $_POST['username'];`

followed by:

`password_verify($_POST['password'], $passwordFromDatabase);`

Is this a better more secure approach? At least on the face of it, it looks like the password isn't exposed if username isn't correct. Any suggestions on best practices and which is a better/different approach(es) would be highly appreciated!
Announcing dip.chat - a virtual coworking space 
Tags: coworking, community
Published: 2019-08-30 14:38:44

---
title: Announcing dip.chat - a virtual coworking space 
published: true
description: a private online virtual coworking space
tags: coworking, community, discuss
cover_image: https://i.ibb.co/DVHgR1q/Screen-Shot-2019-08-30-at-7-24-52-AM.png
---

Hi friends!

Today I'm launching the beta for a new project I've been working on:


### [dip.chat](https://dip.chat/)


I wrote a Twitter thread about it here:👇🏼
[Link to thread](https://twitter.com/jsjoeio/status/1167439340626165760?s=20)
Retrospective Rage Box and other Agile tricks
Tags: discuss, agile, productivity
Published: 2019-08-30 14:36:25

---
title: Retrospective Rage Box and other Agile tricks
published: true
description: Discussion about agile ways of working
cover_image: https://thepracticaldev.s3.amazonaws.com/i/3vu377d15ajbgeqzmjbk.jpg
tags: discuss, agile, productivity
---

### Managing software development is hard. Dah!
God save me, I'm not going to go into this topic, but I'm sure that everywhere in the world teams are struggling to figure out THA WAY to do it. Methodologies like **Kanban, Scrum and Agile** are implemented differently in every group, iterating over and over, changing things here and there to find the best way of working.

> Let's have a daily meeting. Let's not have a daily meeting. Lets have a Kanban board but with extra fields. Let's have a task grooming but in the garden with elephants. Whatever.

Agile is the buzzword of the decade. One particular thing that my team took from there was this [retrospective](https://www.atlassian.com/team-playbook/plays/retrospective) meeting where the team can basically talk about the big picture, in terms of *'harmful'* and *'beneficial'* events.

*But this was boring so we added a twist.*

### Meet the Rage Box

So we have a board where we collect harmful events as *deltas* and *beneficial ones* that could be improved. But a lot of times there are things that realistically can't be improved, and simply just cause frustration!

The **Rage Box** was created for this purpose, so every time you want to let the steam out between colleagues about some nuisance, you put that item in the rage box, and maybe moan about it a little.

### How did you shake up your Way of Working?
I wonder how did you guys change your way of working or any of these methodologies like Kanban, Scrum and Agile to meet the needs of your team?
What language/framework do I need to learn to build user registration? 
Tags: javascript, backend, firebase, learning
Published: 2019-08-30 14:32:55

Hi all. Please pardon my stupid question, but I'm still learning front end, so everything about the back end is mystifying to me. 

I've built an app for learning purpose, but it's just occurred to me that **one day** I'd like to integrate user registration and authentication into it. So what language/framework/platform do I need to learn? Laravel, Mongdb, asp.net, AWS or anything else? 

I don't mind anything, but it's be a plus if it can integrate well with React or Vue, since it is what I'm more familiar with.
How much Python can you learn in a week?
Tags: python, beginners, tutorial, codenewbie
Published: 2019-08-30 14:12:59

---
title: How much Python can you learn in a week?
published: true
description: How to learn python. Beginners guide to learn python.
tags: python, beginners, tutorial, codenewbie
---

If you spend 3–4 hours daily for 7 days, you can learn much more than you think. I am providing this guideline from this android app called: [Programming Hero](https://bit.ly/progHero)

By the way, these are not your regular hours where you study 5mins, then spend 25mins on youtube and then spend another 15mins by regretting why you wasted 25min on youtube. These are solid dedicated learning hours.


#### Day-1: 4 Basic Concepts (3 hours)
1. Variable
2. Display output (print command)
3. Take user input (input command)
3. Math operations (+,-,*,/)
4. Conditionals

#### Day -2: 4 basic concepts (4hours)
1. List (index, append, remove)
2. for loop
3. while loop
4. function

#### Day-3: Simple coding problems (5 hours)
1. Convert miles to kilometers
1. Calculate simple interest
1. Find the largest number in a list
1. Check a number is a prime number or not
1. Sum of all digits in a number
1. Reverse a string (Check palindrome)
1. Calculate age
1. Build a simple calculator

#### Day-4: Data Structures (3hours)

1. Stack 
1. Queue
1. Dictionary
1. Tuples

#### Day-5: OOP (4 hours)
1. Object
1. Class
1. Method and constructor
1. OOP- Inheritance

#### Day-6: Algorithm (4 hours)
1. Binary search
1. Bubble sort
1. Selection Sort
1. Insertion Sort

#### Day-7: Project (6 hours)

1. Build a web crawler
1. or a news aggregator
1. or a simple game using pygame


Purpose of this list is to give you an initial guide. Your actual learning speed might vary depending on the number of devices/distraction you have.

If you feel severe distraction, turn off wifi for 3 hours 😰


You might not master every topic listed above. However, you will be much better than what you are today.

Finally, if you are not sure from where to learn Python,[Check it out](https://bit.ly/progHero) this fun android application
How important is stats knowledge in software development?
Tags: discuss, career
Published: 2019-08-30 13:56:35

I'm not necessarily discussing the hyper-statistic-oriented tangents of our craft, like data science, but for general software development.

I find with myself I sort of take for granted that I have a pretty solid aptitude in stats and it lets me think through problems with those concepts in mind. But I'm wondering what other folks think. What's your understanding of stats, and how important is it as a skill?
Blazorise 0.8.3
Tags: blazorise
Published: 2019-08-30 13:50:26

I'm happy to annouce that new version of Blazorise is now available. You can see [release notes](https://blazorise.com/docs/release-notes/release083/) for a full list of changes.

Github: [https://github.com/stsrki/Blazorise](https://github.com/stsrki/Blazorise)

Docs: [https://blazorise.com/docs/](https://blazorise.com/docs/)

If you like the project please leave a star on [GitHub](https://github.com/stsrki/Blazorise). And as always any feedback is welcome. Thanks
Daily Challenge #53 - Faro Shuffle
Tags: challenge
Published: 2019-08-30 13:20:48

---
title: Daily Challenge #53 - Faro Shuffle
published: true
series: Daily Challenge
description: Write a function that will faro shuffle a list.
tags: challenge
---
**Challenge**
To faro shuffle a deck of playing cards is to split the deck exactly in half, then perfectly interweave the cards, such that the original top and bottom cards are unchanged. 

Write a function that accepts a even-numbered list and faro shuffles the indices.

**Example**
Faro shuffling the list: `['ace', 'two', 'three', 'four', 'five', 'six']`
will give `['ace', 'four', 'two', 'five', 'three', 'six']`

Good luck, happy coding!

***
_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Protect local pages with JWT token
Tags: help, php
Published: 2019-08-30 13:20:19

I have created a JWT using PHP following <a href="https://dev.to/robdwaller/how-to-create-a-json-web-token-using-php-3gml">this tutorial</a>. This is fine and as long as the token has not expired I can view other pages on the server. 

I have a scenario like this: 
**login page**, creates a JWT token on successful authentication.
**View posts page**, this retrieves posts from the server by passing the JWT.

I wondered how I can also protect this **view posts page** from direct access without having to create local sessions. As it stands view posts page can be accessed but nothing will be shown if there isn't a JWT token passed.

Normally the flow is to create a session locally on successful login and maintain the state like, just wondering if there is a way to see use the JWT token locally as well. Hope that makes sense. And if there any security considerations I should make.
Cheers