teleren/devto huggingface dataset:
Daily Developer Jokes - Friday, Jan 17, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-01-17 13:00:15

---
title: "Daily Developer Jokes - Friday, Jan 17, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Friday%2C%20Jan%2017%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259d077252.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Which programming language is the shortest?

___A:___ HTML. Because it doesn't have a neck between its `<head>` and `<body>`.
 -->
Be careful with HTML ID attributes
Tags: html, ids, variables
Published: 2020-01-17 12:19:04

---
title: Be careful with HTML ID attributes
published: true
description: Choose your HTML IDs wisely.
tags: HTML, IDs, Variables
---

**What are HTML attributes?**

![Sample HTML element](https://cdn-images-1.medium.com/max/2000/1*renvPRCHZD4zCH-UQLmaHg.png)

HTML is made up of elements which help define the structure of a web page, Elements of the same type possess the same behavior across a web page. One way to make an element behave differently is by adding properties to them. One of the ways to add a property to an HTML element is using the attributes, for example, you can add CSS styles to elements using selector attributes like classes, ids, and names.

**Working with selectors**

![class and name attributes](https://cdn-images-1.medium.com/max/2572/1*eK9sdplMfX1iQa7CZ3amiA.png)

Selectors help you target specific HTML elements, this way you can easily attach CSS styles or behaviors using Javascript. The most commonly used attributes are classes, ids, and names. Although any of these selectors can be used to add either style or behaviors.

Usually, classes are used to add styles to elements simply because an element can have multiple classes and multiple elements can have the same classes, meaning you can apply multiple styles to an element as well as apply one style to different elements. Names are usually used with input elements to not only mark as the key for the data they collect and send to the server but also sometimes for applying targeted styles. More than one input can share a name, the reason being that you may have more than one form within a page.

**The ID attribute**

![Accessing input values using Id variables](https://cdn-images-1.medium.com/max/3740/1*uURktrf-mV7I7UHXX7kCjQ.png)

**Ids**, unlike classes and names, should be assigned to only one element, its meant to serve as a unique identifier for accessing elements. But based on the specification most browsers convert **ids**  into variables meaning you have access to the DOM of that particular element.

Not using ids carefully could lead to polluting the javascript global scope, this might also lead to problems if your ids collide with the variable names within the global scope.

Also at first glance, this might be seen as an easier way to access the DOM of any element with just the **id** name without having to use query selectors. But this is a bad idea as a browser like Firefox discourages the use of this. It's much safer to just go with query selectors.

**A simple solution**

![Using invalid variable names as Ids](https://cdn-images-1.medium.com/max/3784/1*Xnw1qy4h10Ec7rKvTTdTRg.png)

Unfortunately, the conversion of **ids** into variables is something that is out of your control, but you can gain back that control, one way is to use invalid variable names as **id** names, this way there is no way it will conflict with your variables in the global scope. But sometimes you can’t due to a naming conversation or some other reason, in which case the best option is to try to use fewer **ids** **where** and **when** possible.
TwitCode - Um microblog para desenvolvedores
Tags: productivity, twitcode
Published: 2020-01-17 12:54:54

<center><hr>Post disponível em [inglês](https://dev.to/aicoutos/twitcode-a-microblog-for-developers-2909), [espanhol](https://dev.to/aicoutos/twitcode-un-microblog-para-desarrolladores-53k4) e [português](https://dev.to/aicoutos/twitcode-microblog-para-desenvolvedores-24bi)<hr></center>Quem é desenvolvedor sabe que redes sociais tradicionais são uma enorme distração especialmente por conta do conteúdo que foge da nossa área de trabalho.

## Nasce o TwitCode

[![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/95uniksxx0k2sul71izg.png)](https://twitcode.com)[TwitCode](https://twitcode.com) é um sistema de microblog criado especificamente para desenvolvedores. Dentre algumas de suas funcionalidades estão:
- Mensagens de até 270 caracteres (como no Twitter)
- Mensagens com syntax highlighting (27 linguagens)
- Chat (entre usuários que seguem-se mutuamente)
- Issues (com suporte a hashtags com o id da mensagem)
- Forks (parecido com o retweet do Twitter)
- Stars (semelhante as estrelas do Github)
- Interface traduzida (espanhol, inglês e português)

Críticas e sugestões podem ser feitas aqui. Você pode acessar o TwitCode em https://twitcode.com.
Magento 2 Improved Sorting 
Tags: php, devops
Published: 2020-01-17 12:35:34

[Magento 2 Improved Sorting](https://www.mageants.com/improved-sorting-for-magento-2.html) is the most essential and effective tool for store owners who always care about their customers. You can easily enhance the use of your catalog with user-friendly search options so that your clients can easily browse any catalog or categories by using desired parameters.


**Key Features:**

· Easy for Changing Sorting parameter anytime
· Fully optimized and comfortable for mobile device
· Help to manage product sorting globally
· Easy to promote products
· Improve the user experience by helping visitors find the required           products

Easy sorting always best for users to check the products quickly with less efforts of scrolling and it helps to enhance the user experience. Based on some useful factors including best sellers, ratings, most viewed, bestseller, discount Magento 2 Improved Sorting extension has enhanced a sorting functionality for visitors to sort the products, categories according to their need. You should use it as it attracts users and improves conversion rate with your best sellers.
Smooth scrolling effect using css
Tags: css, beginners, html
Published: 2020-01-17 12:06:47

To add a smooth scrolling effect to an html page you use
the <code>scroll-behavior: smooth;</code> 
css rule.
<code>html {
  scroll-behavior: smooth;
}</code>
<br>

{% codepen https://codepen.io/Adetunji_Tejumade/pen/abzROWK %}
Thanks for reading.
Install Command Line Tools on macOS Catalina
Tags: macoscatalina, commandlinetools, development
Published: 2020-01-17 11:53:34

---
title: Install Command Line Tools on macOS Catalina
published: true
description: Installing command line developer tools on MacOS Catalina
tags: macOS Catalina,command line tools, Development
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ol7ltarlkk3rw0sqsqkg.jpeg 
---
## macOS Catalina
Before we get right to how to install command line tools on macOS, let us look at what macOS Catalina is all about. Apple just made available a major release of its macOS codenamed macOS Catalina (version 10.15). macOS Catalina is the sixteenth release of Apple’s desktop operating system for Macintosh computers. So with the release of macOS Catalina, we say goodbye to [macOS Mojave (version 10.14)](https://en.wikipedia.org/wiki/MacOS_Mojave)

macOS Catalina is the first of its kind to support only 64-bit applications and activation lock. Read more about all the new feature of macOS Catalina from [apple.com](https://www.apple.com/macos/catalina/)

Command-line tools on macOS Catalina is essential to running of commands and development task. Just like with all new versions of macOS you have to install command-line tools to run commands. The good news is the procedure has not changed much across the various versions of macOS

## Install Command Line Tools

Open your terminal to begin the process of installing command-line tools on macOS Catalina. With your terminal opened, type the command below into the prompt and press the return key to execute it. After executing the command below a pop-up window should open with the option to install. The popped-up window should look similar to the image below

```
xcode-select --install

```

![Installation confirmation window](https://thepracticaldev.s3.amazonaws.com/i/75r0e246fwbp1147xnbb.png)

Subsequently, click on the Install button to proceed with the installation of command-line developer tools. Most importantly, as with every application, you have to agree to the license to proceed with the installation. Hence click agree on the license agreement window to continue with the installation.

![License Agreement window](https://thepracticaldev.s3.amazonaws.com/i/0qp8esbaq6819tb9d0w2.png)

Therefore, as a result of agreeing to license the download the command line tools is triggered. After that, the installation will kick in and should not take too long.

![the confirmation window that shows command line developer tools is being downloaded](https://thepracticaldev.s3.amazonaws.com/i/9uvw04mnr1gosozhvb5i.png)


![Installation screen](https://thepracticaldev.s3.amazonaws.com/i/j5rfmfwhvnt05dl6p4wb.png)

Finally, click on the Done button to complete the installation process.

![Final Step](https://thepracticaldev.s3.amazonaws.com/i/05vjz6jnv6inyir7wdza.png)

After that run some beautiful code from the terminal. In conclusion, run your commands from the terminal to confirm the successful installation of command-line tools on macOS Catalina.

Originally published at [https://anansewaa.com](https://anansewaa.com/install-command-line-tools-on-macos-catalina/) on October 11, 2019
Developer's Guide to Common Vulnerabilities and How to Prevent Them
Tags: security, xss, developer
Published: 2020-01-17 11:52:47

---
title: Developer's Guide to Common Vulnerabilities and How to Prevent Them
published: true
description: Learn how to prevent common vulnerabilities such as XSS, injection, and third-party vulnerabilities.
tags: #security #xss #developer 
canonical_url: https://auth0.com/blog/developers-guide-to-common-vulnerabilities-and-how-to-prevent-them/
---

Sometimes as developers, it can be difficult to keep up with the ever-changing frameworks, tools, and releases. You spend a lot of time fixing bugs, refactoring, and frankly just trying to get your code to run. Understandably, a lot of things get pushed to the lengthy backlog list. But should your application's security ever end up on that list?

The short answer is "no." So how can you keep up with all of your other tasks while also making security a priority? The easiest way is to take some time to understand common vulnerabilities and then make prevention a part of the development process. The form that you built works, but leaves you open to an attack? Then it doesn't work.

Luckily, some of the most common attacks don't actually require much extra work to prevent.

In this article, I'll go over some of the most common vulnerabilities that directly affect developers and how you can make simple changes to prevent them. This is not an exhaustive list, but it's a great place to get started. If you'd like a follow-up to learn about even more vulnerabilities, leave a comment below and let me know.

If you're on desktop, feel free to use the menu to the left to skip around to the vulnerabilities that interest you. [Let's get started!](https://auth0.com/blog/developers-guide-to-common-vulnerabilities-and-how-to-prevent-them/?utm_source=dev&utm_medium=sc&utm_campaign=guide_vulnerabilities)
Setting up your Development Environment: Git and Node
Tags: git, node, webdev
Published: 2020-01-17 11:32:45

In this article, you will learn to install Git and Node on your computer.

Steps are as follows:
1. Install Git on your computer
2. Set up some of the basic global configurations for Git
3. Installing Node
4. Complete the set up of Node.js and NPM on your machine
5. Verify that the installation was successful and your machine is ready for using Node.js and NPM.

Install Git on your computer

1. To install Git on your computer, go to https://git-scm.com/downloads to download the Git installer for your specific computing platform.

2. Then, follow the installation steps as you install Git using the installer.

3. You can find more details about installing Git at https://git-scm.com/book/en/v2/Getting-Started-Installing-Git. This document lists several ways of installing Git on various platforms.

4. Installing some of the GUI tools like GitHub Desktop will also install Git on your computer.
On a Mac, setting up XCode command-line tools also will set up Git on your computer.
5. You can choose any of the methods that is most convenient for you.


Some Global Configuration for Git


1. Open a cmd window or terminal on your computer.
Check to make sure that Git is installed and available on the command line, by typing the following at the command prompt:

git --version

2. To configure your user name to be used by Git, type the following at the prompt:

git config --global user.name "Your Name"

3. To configure your email to be used by Git, type the following at the prompt:

git config --global user.email <your email address>

4. You can check your default Git global configuration, you can type the following at the prompt:

git config --list

At the end of this process, you should have Git available on the command-line of your computer.

Onto the Next


Installing Node

1. To install Node on your machine, go to https://nodejs.org and click on the Download button. Depending on your computer’s platform (Windows, macOS or Linux), the appropriate installation package is downloaded.

2. As an example, on a Mac, you will see the following web page. Click on the Download button. Follow along the instructions to install Node on your machine.

3. Note: Now Node gives you the option of installing a mature and dependable LTS version and a more newer stable version.


Complete the set up of Node.js and NPM on your machine

-Open a terminal window on your machine. If you are using a Windows machine, open a cmd window or PowerShell window with admin privileges.


Verify that the installation was successful and your machine is ready for using Node.js and NPM.

-To ensure that your NodeJS setup is working correctly, type the following at the command prompt to check for the version of Node and NPM


node -v
npm -v



At the end of this article, your machine is now ready with Git and Node installed for further development.



I hope you find this article useful :)
Smart Home Automation using Raspberry Pi and Arduino
Tags: raspberrypi, alexa, arduino, smarthome
Published: 2020-01-17 11:19:22

Originally published at [blog.mphomphego.co.za](https://blog.mphomphego.co.za/blog/2018/06/13/Smart-Home-Automation-Project-Using-A-Raspberry-Pi.html
) on Jun 13, 2018


[Updated]: 17 Jan, 2020
- Added repo and project repo links.

------------------------------------------------------------------

# Story

In order to graduate for a BTech in Electronic Engineering back in 2015, I had to designed and develop a project titled: [Smart Home Automation using Raspberry Pi and Arduino](http://bit.ly/372kVdh) and fortunately enough I made a demo about it.

All code is available GitHub.

**Note** that most of the things might be broken, you are welcome to fork, make improvements and submit a pull request.

The project report documentation can be found [here](http://bit.ly/2GazH5X)

{% github mmphego/smarthome-rpi %} 


# Demo

## Primary features
### 1. Some Intro + Smart Alarm

**TODO:** *I guess more text should go here to explain whatever is going on!!!*

{% youtube visOkFoL3eo %}


### 2. Android Application Control

**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube EACmoIVu0B8 %}

### 3. Android Gesture Control

**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube QxTiL1fr8xY %}

### 4. [Somewhat] Web Interface

**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube qj6tPWBQvXs %}

### 5. Presence Detector using IP Sniffing

**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube 85OM4R5eAa4 %}

### 6. TV Proximity Detector

**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube AR9MUh2L1uY %}

### 7. Smart Doorbell

**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube s6tBE6cGTYk %}

## Additional Features
Including interfacing [Amazon's Alexa](https://en.wikipedia.org/wiki/Amazon_Alexa) running on a Raspberry Pi.

### 1. Interfacing DHT11 via ESP8266 to Amazon Alexa

**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube Rpn-UgJLBdY %}

### 2. Amazon Alexa Skill - Intro
**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube nqD50LRBTbE %}

### 3. Amazon Alexa Skill - About Homely
**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube 70d2L8aHXzU %}

### 4. Amazon Alexa Skill - News Retrieval
**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube T59mvy_dyEc %}

### 5. TV Ambient Lighting
**TODO:** *I guess more text should go here to explain whatever is going on!!!*
{% youtube O9x91SrcjoE %}

---------------------------------------
Building a URL shortener service series, Introduction.
Tags: react, python, api
Published: 2020-01-17 11:17:23

Hi, it's been a long time i didn't post here. 

Was mostly working on clients project since couples of months now, mostly as backend developer with Django framework, but in past i was writing Js code with React (before hooks comes out). One of my latest contract leads me to work with AWS and it's quite large, so i decided to train by practicing and obtain 2 certifications this year. My plan for this consist more in building various tools and host them using various AWS services.

# What tool am i building now ?

My first tool is a URL shortener service like bitly. It is small enough to allow me to add new features at every working session and avoid discouragement and stop working.

# Current tech stack:

- Frontend: React.js (JavaScript)
- Backend: Flask (Python)
- Database: Redis & PostgreSQL (or another one)

# What am i expecting to learn ?

- React's hooks
- React's new dev practice (it's been a long time i didn't touch that)
- Flask, yes it feel like a shame to be a python backend dev without experience in Flask, but it's never too late to learn it.
- Some basics UX design principles to build a usable UI
- AWS cache service.
- Small app deployment service with AWS (will need advices here)

# How will i progress ?

As my plan is to work every night on one feature, i will have to made a small blog post about the feature in this series to show my progress and explain what i've learned, where i was stuck and what to do next.

# What i can expect from you

Am open to new ideas about the project and even advices about everything you thing is necessary (from hosting service to project design).

Thank you, hope we will discover great things.
why not fork your own bitcoin ? and learn about blockchaining at the same time
Tags: facebook, libra, cryptocurrencies, blockchain
Published: 2020-01-17 11:17:21

there is lot of news right now about the new facebook libra bitcoin so why not fork one for yourself on github and learn the new language move (NO NOT ANOTHER ONE - i only learnt V last week) at the same time at you print your own money

* https://developers.libra.org/docs/move-paper
* https://github.com/libra/libra

but personally ive sunk all my savings into [beercoin](https://www.express.co.uk/finance/city/1095283/Beercoin-cryptocurrency-drinking-ale-crv)

TODO : PHOTO OF BEER
The only Kubernetes video you need to watch to understand more about K8s than most developers 💪🏼
Tags: devops, kubernetes, beginners, tutorial
Published: 2020-01-17 11:11:16

**Kubernetes has tons of components, but most of the time you are only working with a handful of them.** This video shows you step by step how each component helps you to deploy your application and what the role of each of those components is.

So, it's just enough to get you started using Kubernetes in practice as a devops engineer or software developer.

The video includes the following main components: Pod, Service, Ingress, Volumes, ConfigMap, Secrets, Deployment, StatefulSet.

{% youtube Krpb44XR0bk %}
8 Git command to help you get started 💻
Tags: git, github, codenewbie, tutorial
Published: 2020-01-17 11:10:59

Two weeks back, I wrote an article about a relatively advanced git command that could save your life some day & it blew up way larger than expected!

{% link comscience/the-git-command-that-will-change-your-life-don-t-have-those-git-nightmares-anymore-365d %}

_That article made me the **top writer** for the topic **git** for that week._ 

This time around, I thought I should write something for the ones just getting started with git, the first time git users. What I can recall from my experience, it was quite daunting to me to work on my first git repo. I was confused with so many confusing terminologies being thrown at my face like: _origin_, _master_, _head_ etc and I did not know what to make of it. 

If you are at that stage in your git journey where you just got started and want to understand what is actually happening when you run a git command, here is an animated video tutorial that I created which will come in handy for you. 

{% youtube HDRXwokgWpo %}

Hope that this video is able to create some of your confusions related to the topic and help you become more confident. Feel free to discuss in the comments section. 

Also, If you are one of those people who does not mind seeing this kind of info in your Instagram feed which would help you learn while browsing social media, then consider following the handle I maintain on Instagram. 

{% instagram B1EynqOAJB1 %}

Hope that helped, Cheers!