teleren/devto huggingface dataset:
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2019-05-28 13:00:09

---
title: Top 5 DEV Comments from the Past Week
published: true
description: Highlighting some of the best DEV comments from the past week.
tags: bestofdev
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--7VrAA2ln--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/qmb5wkoeywj06pd7p8ku.png
---

This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag.

**[What are your worst coding habits?](https://dev.to/ben/what-are-your-worst-coding-habits-3if8)**  @selbekk takes the top spot with this very relatable behavior:
{% devcomment b5o7 %}

This was a super fun thread. **[What are you "old enough to remember" in software development?](https://dev.to/ben/what-are-you-old-enough-to-remember-in-software-development-2e28)**  @javierg goes way back here:
{% devcomment b327 %}

After reading **[The "Fake Developer" Conundrum](https://dev.to/badrecordlength/the-fake-developer-conundrum-38oi)**, @syntaxseed offers some wonderful perspective and advice about imposter syndrome:
{% devcomment b3of %}

A more specific question: **[Which editor do you use when opening files like .bash_profile, etc?](https://dev.to/ben/which-editor-do-you-use-when-opening-files-like-bashprofile-etc-1io7)**, @irreverentmike talks about their use of Vim:
{% devcomment b584 %}

This is a great recurring thread to find more DEV members to follow and engage with.  The top comment to the most recent **[Follow Friday: What DEV member would you recommend following?](https://dev.to/aspittel/follow-friday-what-dev-member-would-you-recommend-following-1i55)** thread goes to @maxwell_dev who highlights a number of amazing authors from the community:
{% devcomment b493 %}

See you next week for more great comments ✌
DApp idea: What will happen to your ETH if something happens to you?

Tags: blockchain, ethereum, dapp, smartcontract
Published: 2019-05-28 12:50:56

Hello! It's my first post on Dev.to and I hope the Ethereum community is active here 😁!

I've been traveling the world the past year and I wondered what will happen to my ETH if something happens to me, so I came up with this idea: [https://github.com/antododo/withdrawal-timer](https://github.com/antododo/withdrawal-timer)

What do you think? Do you think it's safe to use `now` in this context?
What is your favorite interview question?
Tags: discuss, interviewing
Published: 2019-05-28 12:48:59

---
title: What is your favorite interview question?
published: true
description: Discussing the interview questions you actually like.
tags: discuss, interviewing
---

We've talked about terrible interview questions:
{% link https://dev.to/elmuerte/terrible-interview-questions-3ka %}

Now, let's talk about your **favorite interview questions**.  This can be answered both from the perspective of the interviewer and as the applicant.
Petite confession
Tags: firstpost
Published: 2019-05-28 12:45:03

---
title: Petite confession
published: true
description: Welcome 
tags: #firstpost
cover_image: https://images.unsplash.com/photo-1518755189305-1261cf432683?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=4051&q=80 4051w
---


I love reading blogs. I've been reading blogs for some time now, I guess, for three years.

I had a lot of privilege reading discussions and reflections of some blog authors on various topics. My daily dose of news and blog analysis continues to grow. I like this feeling that reigns in my mind after reading a carefully written article.

I am very happy to join the party. 

Cheers! 

--- FR ---

J'adore lire des blogs. Je lis des blogs depuis quelque temps déjà, je suppose, depuis trois ans.

J’ai eu beaucoup de privilège de lire des discussions et des réflexions de certains auteurs de blogs sur des sujets variés. Ma dose quotidienne de nouvelles et d’analyses de blogs ne cesse pas d'accroître. J'aime cette sensation qui règne dans mon esprit après avoir lu un article soigneusement rédigé.

Je suis donc très heureux de me rejoindre à la fête et partager avec vous mon opinion.

à bientôt ! 

Ismaïl.
Single Developer, to a duo
Tags: career, advice
Published: 2019-05-28 12:44:10

---
title: Single Developer, to a duo
published: true
description: 
tags: career, advice
---
I am currently the sole developer at my company. A few months go a did some reach to show that what I was getting paid was a bit low for the area/experience that I bring to the company, and to my surprise, I got a raise.

While in the meeting with the CEO and my VP the the plan to hire a junior developer relived to me, along with that was that I would be a mentor to the person that we hire for that role, which I am assuming would help move me along to Senior --> Lead --> Manger path.

While I am excited at the opportunity, I am lost and do not know which direction to go.  Also being that I am the sole developer, I am being tasked to create the Job Description/Skill sets required for the role as well as doing the interviews along side my manager.

Any advice is greatly appreciated.
Blockchain based e-money 
Tags: blockchain, money, emoney, innovation
Published: 2019-05-28 12:24:06

---
title: Blockchain based e-money 
published: true
description: 
tags: blockchain, money, e-money, innovation
---
🚀👏🚀Finally, and after so many months of hard work and team-work I'm happy to be allowed to share cryptix AG vision of future e-money, which is based on #blockchain #futureofMoney!

We, the development- and project-team from <a href="https://fraiss.com">FRAISS</a> are proud to be part of this long lasting partner journey and looking forward to all what's coming next! 

Thanks to visionary people like Bernhard Koch and Anja Frauwallner blockchain e-money will no longer be fictional, it will become #reality.

Read more on https://medium.com/@cryptixAG/cryptix-to-issue-the-first-blockchain-based-electronic-money-4c279cae7da1
Error: GetAddrInfo ENOTFOUND localhost
Tags: beginners, coding, node, vim
Published: 2019-05-28 11:40:55

---
title: Error: GetAddrInfo ENOTFOUND localhost
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/opi8lj34jncub2nqb4a7.png
description: how to fix localhost not found issue from node app and exit vim
tags: #beginner, #coding, #node, #vim
---

I am dropping this here as a reminder for my future self and for anyone that might encounter this weird error.

At work we are using nodejs and serverless framework to build a backend application.  
To test it we just run it locally with 
```
sls offline start --port 3001
```

Today, a colleague who was working remotely asked me if I could run the app locally because he was getting this error: 
![Error GetAddrInfo ENOTFOUND localhost](https://thepracticaldev.s3.amazonaws.com/i/94orzh0du54wdhvfmp8j.png)

The info we found googling were mostly related to Webpack or Angular, which we are not using but had in common some problems in the configuration of etc/hosts.

Confronting that configuration on my workstation and his laptop at home, I had:
![](https://thepracticaldev.s3.amazonaws.com/i/zkpfdsetinvxui60utnt.png)
where his contained info about OpenVN Client SSL but nothing about localhost.  Probably when he configured the VPN to work remotely he overwrote the previous content, he added to his file this one line:
```
127.0.0.1 localhost
```
and everything started to work.

Additional tip:
- To edit the file:  go to home directory ( ```cd ~```) and open vim  ```sudo vi /etc/hosts``` then press I and start editing the file.

![exiting vim](https://thepracticaldev.s3.amazonaws.com/i/9m0zc89irdd23fkqi6b1.jpg)

- To save and exit vim: press ESC then ```:wq```  or ```:q!``` if you just want to exit without saving.
More [cheatsheets here](https://devhints.io/vim)
How I structure a React project
Tags: javascript, react
Published: 2019-05-28 10:51:01

---
title: How I structure a React project
published: true
description: A simple folder convention to keep components in order
tags: javascript, react
cover_image: https://thepracticaldev.s3.amazonaws.com/i/kyh8g6yz2si2dnzyghzo.png
canonical_url: https://maciek.cloud/how-i-structure-a-react-project/
---

There are many guides on how to structure web apps and React in particular.  
* Move files into folders based on Smart/Dumb components.
* Organise them by the Header/Main/Footer
* Or throw everything to Components and combine them in Pages???

I’ve never been fully convinced to use any of these conventions.
And then, about 2 months ago I started a new project. Simple tech stack: React + Express + MySQL.
After a few commits, I had to move the components somewhere.
After a little bit of research, I found something promising.
It's based on 2 resources:
1. [Dan Abramov's official guide](http://react-file-structure.surge.sh/)
2. [Brad Frost's Atomic Design](http://atomicdesign.bradfrost.com/table-of-contents/)

Dan gave me freedom and Brad gave me structure 😅

Atomic Design introduces a new, abstract way to think about project structure. Components are building blocks of an app.
Atoms, molecules, organisms, templates, and pages. This concept brings a breath of fresh air to how we can think about structure.
For my purpose, I used the first 3, but I encourage you to read Brad's guide and adapt it to your liking.

I started with a sketch:
![sketch](https://thepracticaldev.s3.amazonaws.com/i/4gd0sforrkoi0g8a4gdw.png)

Main idea:
3 folders: Atoms, Molecules, Organisms
If the component has logic/state -> move it to Organisms.
If the component has other components -> move it to Molecules.
Otherwise, the component is an Atom.

I like the organic analogy. It creates a mental and logical box for React components. If needed, I can add more non-organic folders for Utils, Routes, API, etc.
A Button will be in Atoms.
A Card will be in Molecules.
Component with Hooks will be in Organisms.

```
src/
  Atoms/
    Button
    ProjectName
    ...
  Molecules/
    ControlBar
    DaysList
    ...
  Organisms/
    User
    CreateUser
    ...
  Utils
    formatMonthData.js
```

For now, this works with no flaws with my project. I will reevaluate this concept when my project grows.
A simple react a11y Emoji component
Tags: react, a11y, beginners
Published: 2019-05-28 10:50:02

---
title: A simple react a11y Emoji component
published: true
description: Very simple Emoji component in react 
tags: #react,#a11y,#beginner
cover_image: https://raw.githubusercontent.com/flrnprz/coverphotos/master/lidya-nada-636142-unsplash_crop.jpg
canonical_url: https://flrnprz.gitlab.io/simple-react-a11y-emoji-component/
---
Emojis are cool, right? Everyone ❤️ emojis, but screen readers have a different opinion about the subject.

For those who don't already know, there are two attributes very useful to help screen readers:

`aria-label` adds a string label to an element, it's useful in cases that the text label is *not* visible on the screen.

`aria-hidden` ([From MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-hidden_attribute)): 
>Adding aria-hidden="true" to an element removes that element and all of its children from the accessibility tree. This can improve the experience for assistive technology users by hiding:
     
>Purely decorative content, such as icons or images.
>Duplicated content, such as repeated text.
>Offscreen or collapsed content, such as menus.

So, these attributes seems a very good idea to our Emoji component. Let's see it in action:

```javascript
import React from 'react';

const Emoji = ({label, symbol}) => (
  <span
    className="emoji"
    role="img"
    aria-label={label ? label : ''}
    aria-hidden={label ? 'false' : 'true'}
  >
    {symbol}
  </span>
);

export default Emoji;
```

If we don't pass a label prop, we want to set aria-hidden to true so screen readers ignore our emoji.

And some use example:

```react
<Emoji label="open book" symbol="📖" /> {timeToRead} min read
```
Which renders something like this:

```html
<span class="emoji" role="img" aria-label="open book" aria-hidden="false">📖</span>
2 min read
<!-- ... ->
```
And this is it! Fun isn't it?
Happy ❤️☕️🐑🐧!

Cover image by [*Lidya Nada @Unsplash*](https://unsplash.com/@lidyanada)
GoDaddy, Surge, Apex Domains & CNAME Records
Tags: dns, cname, godaddy, surge
Published: 2020-05-08 13:49:45

---
title: GoDaddy, Surge, Apex Domains & CNAME Records
published: true
date: 2019-05-28 10:00:00 UTC
tags: dns, cname, godaddy, surge
canonical_url: https://rubensbits.co/posts/adding-surge-cname-to-godaddy
---

* * *

# Problem

### Summary

You need to get an apex domain ([https://yoursite.com](https://yoursite.com)) you purchased at GoDaddy resolving correctly.

### Explanation

The problem you face if your asked to do this is that - for basic domain purchases at least - GoDaddy doesn’t let you add `CNAME` records for apex domains .

> An apex domain refers to [https://yoursite.com](https://yoursite.com) rather than [https://www.yoursite.com](https://www.yoursite.com).

# Solution

### Explanation

1. The advice from GoDaddy is that you must delete all `A` & `CNAME` records on GoDaddy first before adding any other `CNAME` or `A` records.
2. You must replace the `CNAME` `@` record with an `A` `@` record using the IP of your host provider.

My host is surge.sh, who provide their IP in [this documentation](https://surge.sh/help/adding-a-custom-domain).

Thus, to have my domain recognised when deploying to surge I needed to delete all existing `A` & `CNAME` records, and to add the following two records following in the `Type` : `Name` : `Value` format:

`CNAME`: `www` : `na-west1.surge.sh`

`A` : `@` : `45.55.110.124`

Once complete, my domain resolved within 5 minutes.

If you’re struggling to locate your providers IP, try messaging them on Twitter or searching StackOverflow, but once you have it, it should do the trick.

Original source: [GoDaddy Forums](https://www.godaddy.com/community/Managing-Domains/domain-DNS-with-surge-sh/td-p/24075)
Emscripten Node.js tips
Tags: emscripten, node, javascript
Published: 2019-05-28 09:47:27

Intended to collect a bunch of helpful things for the leser mentioned WASM in node.

Story time: I once spoke to a developer who was really into WASM but when I asked about node he laughed, "it's for the browser", a universal compile target doesn't mean the target is platform specific. Its just JavaScript ... And precomputed byte code now apparently.

## 1. Prune browser stuff.
If you only intend to compile to a node target. add `-s ENVIRONMENT='node'` to your compiler args.

This will reduce the main.js output, pruning most - not all browser related bits. - unfortunately emscripten_runscript("console.log('doh!')"); will still look for a window global, doh! thisGlobal, hurry up and be a thing.

For a list of flags see https://github.com/emscripten-core/emscripten/blob/incoming/src/settings.js

## 1.a Make a JavaScript object
Okay you got me, this isn't node specific but it's worth mentioning because the documentation is lacking on the subject. Emscripten provides a header emscripten/val.h , val is a bit special, not only is it a type val X = "some js value", it's also a handy way to create JavaScript object literals and access the ... 🤨 global scope. Despite being advertised as a way to get values out of JavaScript, it can also create values and put them into JavaScript, val X = val::Object(); creates a real JavaScript object!
X.set("key","value"); then you could return this to JavaScript. Assuming you are using embind which I highly recommend.
Those silly mistakes we all make
Tags: discuss
Published: 2019-05-28 09:11:52

---
title: Those silly mistakes we all make
published: true
description: Silly mistakes happen to us all. 
tags: #discuss
---

I've been developing for years. Years! Yet every now and then something that turns out to be simple floors me for just a little bit longer than is comfortable. 

{% twitter 1133250154725646336 %}

Working with code really can keep you humble. What always catches you out or got you stuck recently that really shouldn't have?

Share your silly mistakes and maybe we'll all feel a bit better about it.
React Native VS Native Development: Performance Experiment
Tags: reactnative, swift
Published: 2019-05-28 09:11:34

This post aims to compare React Native to other forms of native development and investigate the differences. This experiment shows the memory usage of two different programming languages, Swift and React Native (see Figure). The purpose of the experiment was to discover which was the more memory efficient coding language and the tests were conducted with applications that looked and functioned identically.

![Reactnative vs Swift: Memory usage](https://thepracticaldev.s3.amazonaws.com/i/tfdj9715y1iyqw7d0vs5.png)

Within the first three views of the application, the difference between the two coding languages was of a minimum percentage that would not be noticeable by a user. However, when moving onto the high memory demanding view of the Maps it was clear that React-Native outshone Swift by using 61MB less memory than Swift.

React-Native has shown to be able to outperform Swift when it comes to memory usage with demanding processes as seen in Figure. The tests were performed in a fair manner with repeated results provided and the average has been represented as on the bar chart in Figure. This is a surprising discovery as it shows that a widely used programming language such as JavaScript can be used to develop efficient applications for mobile devices that can even outperform native coding languages. 

**Disadvantages of React Native**

Although React Native has many benefits to it, the framework is not without its shortcomings. The framework contains clear flaws that can make React Native difficult for some developers to use. Firstly, there is currently only a small amount of documentation available for the framework, with the majority of it being provided by Facebook via the framework’s release notes.

Another issue that React Native has is that the tool is always adapting and changing to newer versions meaning that it is a high maintenance framework. A developer must be ensuring that they are able to know how to use a current version of React Native that is required. Many companies like [app development in San Diego](https://www.bluekiteapps.com/) keep their developers updated with latest releases.

When writing a React Native application it is not always truly cross-platform as the same application cannot make use of both native functionalities and act as a standalone web application simultaneously. React also has a steep learning curve to it, with it being structured and written differently to a usual HTML and JavaScript web application. This learning curve may hinder the production of the application.

As React Native is able to utilize native components and functionality, in order to use it to its full potential, a developer must have pre-existing knowledge of native development on that platform. However, these disadvantages are all able to overcome by a developer who is committed to the application that they are developing.
Welcome Butterfly Backup
Tags: python, backup
Published: 2019-05-28 08:53:02

# What is Butterfly Backup
Butterfly Backup (BB) is a simple wrapper of rsync written in python;

## Why use it?
Because it is simple and very effective, as it catalogs the backups performed (and archived).

BB is a simple tool, born from a very clear need: to make backups without having agents that slow down the machine and to have catalogs for the interrogation by operators in case of restore.

Thanks to an active community, BB has arrived at version 1.5, but 2.0 is in development.
Every contribution is welcome!

site: https://matteoguadrini.github.io/Butterfly-Backup/
docs: https://butterfly-backup.readthedocs.io/en/latest/
MicroBitcoin’s 1st anniversary is coming up on 5/30!
Tags: microbitcoin, opensource, blockchain, community
Published: 2019-05-28 08:14:04

---
title: MicroBitcoin’s 1st anniversary is coming up on 5/30!
published: true
description: Free airdrop event for MicroBitcoin’s 1st anniversary
tags: microbitcoin, opensource, blockchain, community
---

MicroBitcoin’s 1st anniversary is coming up on 5/30!
We want to thank all the community members, developers, and contributors for the past year!

In celebration, we will be MAKING IT RAIN in our Discord channel the next few days! Check the schedule below 👇

5/29:
1. 06:00 am UTC
2. 12:00 pm UTC
100,000 MBC goes to the first 10 users who can grab it! (10,000/each)

How to join:
Tell your friends!
Join our Discord channel!
https://discord.io/microbitcoin 

When Make it Rain happens, be quick to click on the MONEY EMOJI before someone else!
A Beginner's Guide to the World of PHP
Tags: php, beginners, started
Published: 2019-05-28 08:01:18

**Introduction** 
[PHP](https://php.net/) is an open-source server-side scripting language; it is free to use (you don't have to pay for licenses etc.) and it supports Windows, Linux and Unix servers. Developed by **_Rasmus Lerdorf_**, the language (PHP) is one of the most used server side scripting languages for web development with a a thriving ecosystem of PHP programmers, it is also beginner friendly; judging from online testimonials, PS. I am also on this journey as an explorer and learning enthusiast.

Your PHP code is embedded in HTML delineated with special start and end tags _"<?php" and "?>"_. The start and end tags tells your server that the codes in between is PHP and should be executed on the server and before it is then sent to your browser. The web page displayed is the file generated from the code's execution. The underlying PHP code is hidden from the user.


**Some of PHP's Strengths**
PHP provides a level of source code security. As a server-side scripting language, the user-client does not see your source code, it is only available to the server and people maintaining the server files. This adds a layer of security to your scripts.

No browser compatibility and configuration issues. PHP scripts are interpreted and run on the web server alone, so there’s no need to worry about whether the language features you’re using are supported by the visitor’s browser and this also eliminates issues arising from client-side configurations.


**Supports Database connectivity**
PHP supports connection to a number of databases including but not limited to: MySQL, Oracle and more.


**Alternatives to PHP**
If you've experimented with PHP and still feel like checking out other server-side languages, you can use any of the following: Node.js, Ruby, Python, Erlang, PERL, Microsoft ASP.NET, JavaSErver Page etc.


**Installing as a module for Apache Web Server**
To run PHP, your web browser needs some help. Web browsers do not understand PHP scripts. If you files are hosted online then probably your Web Host would already have PHP Set-up for You. For beginners it is good practice to have a local server on your PC this way you can experiment with and test your PHP scripts. For Local Development servers there is a number of options available, they include; [XAMPP](https://www.apachefriends.org), [WAMP](http://www.wampserver.com/en/), [LAMP](https://bitnami.com/stack/lamp/installer), [MAMP](https://www.mamp.info/en/).



_Note: This article would be updated from time to time as I continue to explore, feel free to point areas If I missed something and also share your thoughts on this piece with me, Cheers!_
how to proceed gathering information on programming game server's logic ?
Tags: gamedeveloper, gamedesigner, gameserver, backenddeveloper
Published: 2019-05-28 05:13:36

---
title: how to proceed gathering information on programming game server's logic ?
published: true
description: Can someone take time to point me in right direction.
tags: game developer , game designer, game server , backend developer 
---

Hey , I am game developer. And I want to build a sports multiplayer and host it on cloud (aws or gcp). But I don't know how to do this? I lack information on how to build game server logic. I know how to build web server and networking. Please somebody guide me in right direction or provide me a learning path. Thanks in advance.