teleren/devto huggingface dataset:
Evening Rust: Episode 2 - Ratchet up to Medium
Tags: video, coding, rust, competition
Published: 2018-01-15 08:06:32

---
title: "Evening Rust: Episode 2 - Ratchet up to Medium"
published: true
description: I journey to Mars, appropriately colored, to continue my Rust learning.
tags: video, coding, rust, competition
cover_image: https://thepracticaldev.s3.amazonaws.com/i/cufddompx4f3ljhjvbvv.jpg
---

{% youtube T3F2daD2VIA %}

Grabbing our rusty toolbox we leave behind the graphic-less challenges of Easy Valley and head off to Medium Crater. We sway away the ever battling "isize" and "usize" bats to save the world from SkyNet and rescue a Marvin clone... mind you, not without overheating my computer first.

Subscribe to my [Twitch Channel](https://www.twitch.tv/mortoray) to watch live. Commentary appreciated.
ジョエル・スポルスキはなぜTwitterとFacebookから距離を置くのか
Published: 2018-01-15 08:01:08

---
title: ジョエル・スポルスキはなぜTwitterとFacebookから距離を置くのか
published: true
description: 
tags: ノート
---

from https://www.joelonsoftware.com/2018/01/12/birdcage-liners/

- 新年の挑戦はTwitterとFacebookを読むのをやめること
- これらのフィードを読むと腹が立つし、ストレスを感じる
- Twitterの友達はほとんど嫌なニュースをつぶやき、くだらない論争をはじまる
- Twitterは結局、二極化と怒りを生み出すことによって生き残っているのだ
- FacebookもTwitterのように、フィードを中毒性のあるアルゴリズムで選別している
- 犬を躾ける方法として、命令をきけば常に褒美を与える方法だと、一度でもご褒美を忘れると条件反射が消去される
- そうではなくたまに褒美を与える方法だと、褒美がなくても次の命令をきくように努力を続ける
- Facebookのアルゴリズムはこの犬の躾のように、常に褒美（いいニュース）を与えるのではなく、くだらない話や聞きたくない話をまぜるのだ
- このアルゴリズムは政治信条的にも世界を二分し、「反対勢力」のひどい話を伝えようとしたりする
- このようなアルゴリズムがある限り、TwitterやFacebookに時間を費やすことは、市民社会を破壊するようなものだ
- ソフトウェア開発者として、世界をより良くするように慎重に考え、ソフトウェアをデザインする責務がある
Looking for the HHTTPS protocol
Tags: meta
Published: 2018-01-15 07:02:21

---
title: Looking for the HHTTPS protocol
published: true
description: 
tags: meta
---

![hhttps](https://thepracticaldev.s3.amazonaws.com/i/9rtln4wsdnqs9mwuhoh0.png)

The real URL https://res.cloudinary.com/practicaldev/image/fetch/s--HjVUshkb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8l29vxiir8k5d097o9o8.png
CSS Flexbox in 30 seconds
Tags: css, inthirtyseconds
Published: 2018-01-15 06:57:01

---
title: CSS Flexbox in 30 seconds
published: true
description: 
tags: css, inthirtyseconds
---
Flexbox is a CSS layout mode that aims to simplify responsive layout development. Flexbox layouts use two types of elements: flex containers and flex items. Flex containers have a primary axis (called the main axis) and a secondary axis (called the cross axis). Flex items are nested inside flex containers and can be aligned, sized, scaled, and ordered relative to the main or cross axis of the container. The visual order of flex items on the screen is independent of their HTML source order.
夢中になるプロダクトをデザインする方法
Published: 2018-01-15 03:50:36

---
title: 夢中になるプロダクトをデザインする方法
published: true
description: 
tags: ノート,デザイン
---
from https://medium.com/swlh/how-to-design-an-addicting-product-29b948c427de

- デザイナーの目標は機能的で直感的で快適なものをつくることだというがそれが正解なのか？
- 内発的動機付け(intrinsic motivation)もしくは探索システム(the seeking system)が重要
- Drive-Reduction Theoryによれば、空腹などの身体的な欲求が人間の行動源だとされた
- しかし猿の実験により、パズルを解くと食料を与えるようにすると、与えないよりも比べて逆に興味を失うことがわかる
- これを内発的動機づけ"intrinsic motivation"と名付ける
- 内発的動機づけとは、目新しいものやチャレンジングなものを探して自らの可能性を試したり学んだりする自発的な傾向のこと(Ryan and Deci, 2000, p.70)
- テレビやゲームや旅行や読書、ネットフリックスで作品を探すことに至るまで内発的動機の賜物
- ネットフリックスで作品を探すことに熱中するように、面白そうなものを探すこと自体に価値を感じる
- ソーシャルメディアがなぜ重要かというと、コメントやリアクションによってその探索を手助けしてくれるから
- 釣りやカジノのようにランダム性、大きな報酬に中毒性がある
- なぜ人間は探索するのか？個人的にはメリットがなくても種として探索をして資源を探すことで生存率が高まる
- 夢中になるプロダクトを提供するためには人々に探索をさせ、ソーシャルなフィードバックを受け取れる必要がある
- 探索は人間の活動の根源的なものであり、より大きなものに貢献する感覚を与えてくれる
why does NPM install extra modules?
Tags: discuss, webdev, node, javascript
Published: 2018-01-15 03:03:53

---
title: why does NPM install extra modules?
published: true
description: Tried installing express with npm but got some additional folders.
tags: discuss, webdev, node, javascript
---
I am new to web development, currently learning [Node.js](https://nodejs.org/en/) and [Express](http://expressjs.com/) is the first web framework i am diving into, since that's the stack the online course i am following work with (and i am quite happy with it).
While trying to to [npm](https://www.npmjs.com/) install Express to the directory i am working in, i have noticed that not only express module was install but also a bunch of other modules:

![node_modules](https://thepracticaldev.s3.amazonaws.com/i/57iwamsz2x2nygync3ob.PNG)

So, my questions is: **What's the need for all those extra modules? and are they necessary for express to function well?**

and Thanks in advance
E2E Testing with TestCafe | Multi-browser Testing
Tags: testcafe, e2e, testing, javascript
Published: 2018-01-15 02:35:31

---
title: E2E Testing with TestCafe | Multi-browser Testing
published: true
tags: testcafe, e2e, testing, javascript
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--FiNIdQbx--/c_imagga_scale,f_auto,fl_progressive,h_500,q_auto,w_1000/https://community.devexpress.com/blogs/thinking/TestCafe/browserstack-img-1.png
series: E2E testing with TestCafe
---

On [Part 2](https://dev.to/chrisvasqm/e2e-testing-with-testcafe--part-2-1lfg) we learned how to run tests in parallel, but we only did it by using the Chrome browser.

Now we are going to run our tests in both Chrome and Firefox.

# Requirements

- Install Firefox driver (known as _geckodriver_).

# Installing Firefox driver

In order to install the geckodriver, we'll need to execute the following command in our CMD or Terminal:

```
npm install -g geckodriver
```

Check your `geckodriver` version by also running:

```
geckodriver --version
```

Mine is `0.19.1` as I'm writing this post.

# Running Chrome and Firefox

To start, let's run only 1 instance of Chrome and 1 instance of Firefox at a time with this command:

```
testcafe chrome,firefox tests/devto.js
```

> _Make sure to **not** add any whitespace after the comma that separates `chrome` and `firefox` in the command above._

This will make both of your browsers startup and run our 2 tests individually in each browser respectively.

Great!

This will allow us to verify that our application is working correctly in multiple browsers without having to run a command for each and every browser we want to try out.

What about more than 2 browsers? You can do that, as long as you have the required drivers and the browser itself installed on your machine (like Safari/Internet Explorer that are exclusives to macOS/Windows respectively) you will be good to go.

## Let's take it to the next level

If you followed the instructions in [Part 2](https://dev.to/chrisvasqm/e2e-testing-with-testcafe--part-2-1lfg), you may be able to remember the `-c #` command we can add to `testcafe` so it runs multiple windows of the same browser to split the work between them. 

Well, now let's do that with both Chrome and Firefox!

Since we already have our `geckodriver` installed by now, we can go ahead and use:

```
testcafe -c 2 chrome,firefox tests/devto.js
```

This should open 2 Chrome windows and 2 Firefox windows.

Did all the test pass on both browsers? 

### Awesome \o/

Now I think you are starting to get the hang of how to use some really useful commands for `testcafe`.

These are the same ones that you will be using when setting up your CI or Continuous Integration systems (like Jenkins, CircleCI, etc) in order to run these test automatically every X amount of time.

On Part 4 we will refactor our project in order to support the Page Object Model Design Pattern, which will help us clean up our code, make it more expressive and reusable through out all our tests.

{% link https://dev.to/chrisvasqm/e2e-testing-with-testcafe--part-4-1glp %}
E2E Testing with TestCafe | Pararell Execution
Tags: testing, e2e, testcafe, javascript
Published: 2018-01-15 02:16:01

---
title: E2E Testing with TestCafe | Pararell Execution
published: true
tags: testing, e2e, testcafe, javascript
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--FiNIdQbx--/c_imagga_scale,f_auto,fl_progressive,h_500,q_auto,w_1000/https://community.devexpress.com/blogs/thinking/TestCafe/browserstack-img-1.png
series: E2E testing with TestCafe
---

_[Previously](https://dev.to/chrisvasqm/e2e-testing-with-testcafe-17jl) in "E2E Testing with TestCafe"..._ 

We covered the following topics:

- What E2E and TestCafe are.
- Installing NodeJS, TestCafe, IDE/editor.
- Setup the project.
- Making our first test.
- Running our first test in a single browser.

This time we will learn about

# Running tests in parallel

This can be achieved by using a command like this:

```
testcafe -c NUMBER-OF-BROWSERS BROWSER PATH-TO-TEST-FILE
```

But (there's always a but!) if we run it now something weird will happen...

Our "Check founder's names" test is not going to fail, but we will be able to see that the second Chrome browser will do nothing.

_What a lazy browser_, you might think.

This is actually quite an interesting way of doing parallel execution.

Since we only have 1 test method in our `devto.js` file, the second browser is not being lazy, it just has nothing to do. Why would he waste his time doing the same test as the first browser?

Don't believe me? Let's add another test:

(I'll give you the entire test method so you can go ahead and copy-pasta into your editor to quickly run the tests again)

```js
test("Filter articles by discuss tag", async (t) => {
    const discussTag = Selector('span').withText('#discuss');
    const discussTitle = Selector('h1').withText('Discussion');
    
    await t
        .click(discussTag)
        .expect(discussTitle.exists).ok();
});
```

Now use this command:

```
testcafe -c 2 chrome tests/devto.js
```

Make sure to separate each Chrome window so you can see how they both work at the same time.

Cool, but what happens if we have more tests? Should we pass the same `-c #` as the amount of tests we have? Probably not. You would be using a lot more resources if you try to open too many browsers at once. 

What it will actually do is that if we have 3 tests and we give it a `-c 2`, whichever browser finishes it's test first will take the 3rd one. And so happens if we had 4, 5, or more tests.

This is super useful after our test suite has grown later on in development. This will help you cut the time of E2E tests in half, or even more!

In Part 3 we will be running multiple browsers and then multiple instances of each browsers.

{% link https://dev.to/chrisvasqm/e2e-testing-with-testcafe--part-3-2io7 %}
How to Configure Visual Studio Code’s Formatter Supports JSX?
Tags: javascript
Published: 2021-05-25 03:34:33

---
title: How to Configure Visual Studio Code’s Formatter Supports JSX?
published: true
date: 2018-01-15 02:13:50 UTC
tags: Javascript
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvzial5fiv9stqs9vd25.png
---

Are you annoyed with Visual Studio Code’s formatter when working with JSX?

It happened to me earlier. I have the habit to format the code after coding to make the code more readable and beautiful. The VSCode formatter works well on many language, until I worked with JSX in JavaScript file…

It can turned the code like this…

![Original JSX Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/57zsxelqxqrills5v1iz.png)

transformed to this ugly guy…

![Transformed JSX…](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/di7ujyuhailryfdvx9x6.png)

## Simple Solution

Most simple solution is just click on Language Mode on the bottom right of Visual Studio Code and change from **JavaScript** to **JavaScript React** instead.

![Click on JavaScript Language Mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xef2rfdlmoiixyhcipdu.png)

![Then choose JavaScript React Instead](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d95ykhxl6m1ebmxhq2fd.png)

Now you can work without worry that formatter will breaks your JSX.

*But wait … Do I need to do these steps on every *.js files?*

No! Actually, you can tell Visual Studio Code to use **JavaScript React** language mode on every JavaScript file by default.

Configure Visual Studio Code Supports JavaScript React by Default

Go to user settings.
 In Windows and Linux go to menu **File > Preferences > Settings**
 In MacOS go to **Code > Preferences > Settings**

![Go to settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ya1iayciwcigcu1ghzfs.png)

Search for files.associations, the files associations setting will be shown as the first result, click on Edit in settings.json

![Edit File Associations](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hhhe6hc43gzlecq3gep2.png)

In the left panel it will be default user settings, which is usually empty, and in the right panel will contains user settings that will overrides the system settings. Your settings should be like example below.

![Original](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a3thcoyv9sbxhnraeyzr.png)

Your exists settings might be different, but we just add a new files.associations settings to let all JavaScript files support **“javascriptreact”** language mode by default. So you just adding these property and value:

```javascript
{
    "files.associations": { "**.js": "javascriptreact" },
    "another-config": "xx"
}
```

This make our life easier! I hope this guide will be helpful to you guys. Happy coding!
What are your coffee habits?
Tags: discuss, coffee
Published: 2018-01-15 01:24:36

---
title: What are your coffee habits?
published: true
description: 
tags: discuss, coffee
---


As developers, we cannot deny that coffee is a big part of our culture. I've seen divided opinions such as people despising coffee and people who can't function without them.


Personally, I believed the blogs that say *"we should not depend on caffeine"* but on the latter half of 2017, I started enjoying coffee myself. This year I have only had a few so far. So I consider myself just a casual coffee drinker. 😅 What I enjoy about it so much is the flavour! And the added *Energy +25* is just a bonus. 😉

How about y'all? Do you recommend coffee or not? What are your coffee habits? 😊
Deploy Angular Apps To Surge
Tags: angular, javascript, deployment
Published: 2018-01-14 21:36:34

---
title: Deploy Angular Apps To Surge
published: true
description: 
tags: angular,javascript,deployment
---

I usually use Heroku for hosting my Angular Apps. It works fine but I want to try anything else: something new, something smart. I heard about two deploying tools dedicated to front-end developers: Netlify and Surge. In this article, I will show you how to deploy Angular apps to Surge.

## What’s Surge?
Surge is a simple tool for publishing HTML5 apps without leaving the command line. Surge is powerful. I took 10 or 20 minutes sometimes for publishing Angular Apps on Heroku because you need to create a Procfile, add express and angular-cli on app’s dependencies and so on. But with Surge, you need to build your app and it’s alive!

## How to do it?
First install Surge using npm:
```
$ npm install -g surge
```
Create a new Angular app:
```
$ ng new angular-surge
$ cd angular-surge
```
What you need to do now is to build your application for production environment.
```
$ ng build --prod
```
Now angular-cli put the build artifacts into dist folder. You need to deploy this folder with surge. Let’s move into dist folder with command line and start deploying.
```
$ cd dist
$ surge
```
Voila! Account creation will happen on your first run. Surge will show you where your application is alive on. Enjoy!

You can do more with Surge. Custom domain, 404 page, SSL and so more. Here is where you can start with these functionalities of Surge.

Never forget that you can deploy your Angular apps in one minute or less with Surge!!!

Happy coding!
Originally published at [Medium](https://medium.com/@nioperas06/deploy-angular-apps-to-surge-7ee763db2235) on January 14, 2018.
What is GraphQL schema stitching & why do I need it?
Tags: graphql, explainlikeimfive
Published: 2018-01-14 19:22:21

---
title: What is GraphQL schema stitching & why do I need it?
published: true
description: schema stiching question
tags: graphql, explainlikeimfive
---

Explain it to me like I'm five!

What's are they and why do you need them when working with graphQL?
Is PHPDoc now redundant?
Tags: php, discuss
Published: 2018-01-14 18:45:31

---
title: Is PHPDoc now redundant?
published: true
description: Is PHPDoc truly redundant thanks to changes in PHP 7+?
tags: php, discussion
---

I've heard around the web that PHPDoc is now basically redundant thanks to the new features in PHP 7+ (return types etc.).

Should we still use it or is it truly pointless?

Opinions please :)

_P.S: First post on dev.to!_
Python List Functions – The Definitive Guide
Tags: python, programming, tutorial
Published: 2018-01-14 17:44:59

---
title: Python List Functions – The Definitive Guide
published: true
description: 
tags: #python #programming #tutorial
---

Python list is a sequence of values, it can be any type, strings, numbers, floats, mixed content, or whatever. In this post, we will talk about Python list functions and how to create, add elements, append, reverse, and many other Python list functions.

1 Create Python Lists
2 Mutable Lists
3 Traverse a List
4 Slice a List
5 Insert Into a List
6 Append to a List
7 Sort a List
8 Reverse a List
9 Index of an element
10 Delete an Element
11 Aggregate Functions
12 Compare Lists
13 Math Operations On Lists
14 Lists and Strings
15 Join a List
16 Aliasing

https://likegeeks.com/python-list-functions/

Thanks in advance.
Convert An Array To Object Using PHP (Hydrator Pattern)
Tags: php, webdev
Published: 2018-01-14 17:42:05

---
title: Convert An Array To Object Using PHP (Hydrator Pattern)
published: true
description: 
tags: #php #webdev
---

In this post, we will convert an array to object using PHP hydrator pattern. This method is so simple, it’s about transferring data from one place to another.

We will define a class that will take an array and an object as inputs and search for all set() methods in the object and fills it with values from the array.

https://likegeeks.com/convert-array-to-object-using-php/

Thanks in advance.
Dagger-2 dagger.internal.Preconditions.checkNotNull is NULL
Tags: dagger2, android, helpneeded, di
Published: 2018-01-14 14:41:38

---
title: Dagger-2 dagger.internal.Preconditions.checkNotNull is NULL
published: true
description: NUllpointerException on component in dagger-2 android app
tags: #dagger-2 #android #helpneeded #di 
---

Hello everyone,

I really need your help on the following error:
https://thepracticaldev.s3.amazonaws.com/i/t03c40x72b5ukxynhhox.png

This is appearing already for many hours as an error and can't find a way to fix it.
It is my first time configuring dagger on my app, any help will be appreciated!

If you need more info just let me know!
Any good PHP code obfuscators which are hard to deobfuscate?
Tags: discuss
Published: 2018-01-14 13:36:34

---
title: Any good PHP code obfuscators which are hard to deobfuscate?
published: true
tags: discuss
---

Any good code obfuscators? Tried phpprotect, etc. They just either scramble the identifiers or encode the code in base64. And it seems pretty easy to deobfuscate that. I want something really hard to deobfuscate i.e., get the original code.

Also I tried FOPO.com.ar , actually it was working fine. But after a while my production server started giving error stating that the file in which I'm using FOPO's obfuscated code is Malicious. And the server is automatically deleting the file having FOPO'S obfuscated code.

So guys, can you please suggest any good code obfuscator like FOPO (which uses a cipher key to deobfuscate the code)?

P.S: Free ones first. :P
How writing can also be a teacher
Tags: write, learn
Published: 2018-01-14 13:26:13

---
title: How writing can also be a teacher
published: true
tags: write, learn
cover_image: http://media.beam.usnews.com/51/4a/ed8926e6437f838e7a6d66c7cba9/150929-students-editorial.jpg
---

Writing can be a daunting task for anyone, especially for those who haven't done it before.

Much like when we experience _glossophobia_ on stage, we tend to think that our words have no meaning or value to others. That we will just _repeat what everyone else has said_, yet, there are still people writing books everyday. 

> _"**Glossophobia**: fear of public speaking"_ - www.macmillandictionary.com

So, what do I mean by saying that "writing can also be a teacher"?

Well, you have probably heard of this quote before:

> _"Heeded my words not, did you? Pass on what you have learned. Strength, mastery. But weakness, folly, failure also. Yes, failure most of all. **The greatest teacher, failure is.**"_ - Master Yoda, Star Wars.

Writing _can_ also be a teacher as well.

# When to start

Last week, during one of my lunch breaks, I was sharing my experience about how welcoming the DEV community can be for people of all skill levels and one of my colleagues commented about some of my previous posts while the other continued to just keep eating. But there's one thing that really stood out from the conversation.

We were only 3 people on that table and the most quiet one said:

> _"I don't even know what could I begin with. I don't think I know enough about anything to actually write about it."_ - Colleague #1

And both Colleague #2 and I stopped really quick, looked at each other and then looked at him as we both said:

> _"That's the key."_ - Colleague #2 and I.

Then, Colleague #2 continued with:

> _"Putting yourself in that situation will require you to **do your best**. Whether it comes from pure curiosity or just the fear of being told that you are wrong by your readers."_ - Colleague #2.

And then we continued to explain how it would push him to reach a higher level of understanding about the topic he chooses. No matter how simple it might be.

So, when should you start writing? A long time ago.

# Being wrong

Let me quote a fragment of what Colleague #2 previously said:

> _"[...] or just the fear of being told that you are wrong by your readers."_ - Colleague #2.

This is the most powerful thing that can happen.

Yes. Being told you are **wrong**.

Initially, it can be heart broken. Who knows how many hours you spent writing that down? How many edits were needed before you finally released it?.

All that doesn't matter.

What was your initial purpose with writing? Teaching others or expressing yourself.

That ugly comment that proves your whole theory wrong is the best thing that can happen. Because now you know how **_not_** to it.

### _The End._
What is your learning roadmap when you first started learning Node.js?
Tags: web, javascript, node
Published: 2018-01-14 06:21:10

---
title: What is your learning roadmap when you first started learning Node.js?
published: true
description: 
tags: web, javascript, node
---

Just like this [excellent roadmap for being a modern web developer](https://github.com/kamranahmedse/developer-roadmap), do you have your own roadmap or some kind of curriculum when you first started out with Node.js?

~~Right now, I'm having a hard time with Async and Promises and so I wanted to learn it from bottom to top.~~

EDIT (2018/01/22): [I just conquered Promises!](https://medium.com/@endan/enzo-learns-part-12-conquering-promises-sort-of-13f65a5d73dc) 🤩

I'm from a PHP background and just jumped onto the Node train, but well... things are so much different. 😅

Does anyone have a good resource regarding this? What is your own roadmap in learning Node?