teleren/devto huggingface dataset:
Twitter coding quizzes and JavaScript infinite reach
Tags: javascript
Published: 2020-02-03 01:31:53

One of those Twitter quizzes: If you're born in month X, you program in language Y for the rest of your life. For me, JavaScript was the resulting language. This got me thinking... JavaScript is technically an infinite-reach language, because Electron covers native wrappers, NodeJS covers servers, while browsers cover clients. That's everything, right?

Silly analogy aside, it sure seems like I can truly reach just about anything anywhere with JS - whether it's a web game, a database-driven app, a single-page web app, a progressive web app, or even all four of those things in one - all the common modes of consumption are possible, if not easy, to cover! Perhaps this is why so many people are looking towards WebAssembly as the wave of the future, but there isn't exactly a NodeJS equivalent. Then again, is one really needed? You need a compiler to produce WebAssembly anyway, suggesting that native server code is only a small leap from there.

Wow, does this mean the web is truly more universal than I ever realized, and only now did it occur to me? What have I missed out on all these years of being a desktop app developer? I have some serious catching up to do, it seems.
Keep Nested Resource Routes Succint With The Shallow Option in Laravel
Tags: laravel, php, webdev
Published: 2020-02-03 01:06:26

I just got my first PR merged into Laravel! It adds the option for `shallow` resource routes. You can see the PR [here](https://github.com/laravel/framework/pull/31208).

Without any prior knowledge of Laravel internals this feature took me about an hour to develop. Props to the Laravel maintainers for an easy to navigate codebase and quick PR resolution!

### Shallow Nesting

It's a good practice not to nest resources too deep. Routes and their url helpers quickly get unwieldy. Shallow nesting is a way to prevent deep nesting of resources. Collection actions (index, new, create) are scoped to the parent to provide context, while member actions (show, edit, update, destroy) are placed in the root or namespace when provided. This strikes a nice balance between being descriptive and being compact. An additional advantage is that records will have a single canonical route.

To achieve this we needed to configure our routes like:
```php
Route::resource('foo.bar', 'BarController')->only(['index', 'create', 'store']);
Route::resource('bar', 'BarController')->only(['show', 'edit', 'update', 'destroy']);
```

With the `shallow` option we can simply type:
```php
Route::resource('foo.bar', 'BarController')->shallow();
```

And have the following routes generated for us:

```
| PUT|PATCH | bar/{bar}            | bar.update     | App\Http\Controllers\BarController@update  | web,auth |
| DELETE    | bar/{bar}            | bar.destroy    | App\Http\Controllers\BarController@destroy | web,auth |
| GET|HEAD  | bar/{bar}            | bar.show       | App\Http\Controllers\BarController@show    | web,auth |
| GET|HEAD  | bar/{bar}/edit       | bar.edit       | App\Http\Controllers\BarController@edit    | web,auth |
| POST      | foo/{foo}/bar        | foo.bar.store  | App\Http\Controllers\BarController@store   | web,auth |
| GET|HEAD  | foo/{foo}/bar        | foo.bar.index  | App\Http\Controllers\BarController@index   | web,auth |
| GET|HEAD  | foo/{foo}/bar/create | foo.bar.create | App\Http\Controllers\BarController@create  | web,auth |
```

Expect this feature to land in the next release of Laravel 6.x!

**Update:** This has now been released in [Laravel 6.13.0](https://laravel-news.com/laravel-6-13-0)!
Working with Dev.to's API using NodeJS
Tags: node, javascript, codenewbie
Published: 2020-02-03 01:04:43

So I've wanted to start blogging more about JavaScript and programming.

The thing holding me back has been that I know that I do not know. 

I know I'm still relatively new and inexperienced.

I know I have plenty to learn.

To get rid of that excuse, I realized that I could open up my blog posts to feedback and edits.

I could connect them to GitHub and have make people make commits and issues and pull requests just like they would if I was coding something.

So I worked with [Dev.to's API](https://docs.dev.to/api/) to automate this process.

All of this was done with [Node.JS](https://nodejs.org/en/), [Axios](https://github.com/axios/axios), and [Dotenv](https://www.npmjs.com/package/dotenv)

If you want to set up your own NodeJS application to use Dev.to's API, [here's a link to my repo](https://github.com/cpustejovsky/blog-posts)

If you think this article needs updating, [please let me know](https://github.com/cpustejovsky/blog-posts/blob/master/posts/post-to-update-1nd.md).
What do you do with your old programming books?
Tags: discuss
Published: 2020-02-03 00:58:12

I've been trying to clean up my bookshelf at home & my desk in my office recently and noticed I have a lot of outdated programming books - like really old ones - WebMatrix, Angular 1.x, Joomla, Rails 3...

I guess the only sensible thing to do is to recycle them? 🤔 what do you do with yours?
20 Highest Paying Skills for Freelancers
Tags: career, productivity
Published: 2020-02-03 00:01:09

Independent workers can make more money than employees with more flexibility than ever.

73% of freelancers earn more than when they were a traditional employee.

The skills that pay a lot ranges from finance, marketing, to high tech.

The following is the 20 highest payment skills per hour in US dollars:

1. Legal Services Expert: $70 – $120
2. Web Developer: $60 
3. Internet Security Specialist: $50
4. SEO Specialist: $50 
5. Copywriter: $47
6. Voice Actor: $46 - $52
7. Recruiter: $46
8. Teacher: $41
9. Translator: $31
10. Game Developer: $31
11. Social Media Coordinator: $25
12. Article and Blog Writing: $25
13. Graphic Designer: $23
14. Illustrator: $21
15. Transcriber: $20
16. 3D Modeller: $18 - $20
17. Marketing Consultant: $13 - $25
18. PR Consultant: $13 - $22
19. Administration Support Officer: $11-$13
20. Customer Service Support Officer: $8-$12

As we can see, most of these can do done over the Internet. It gives us freedom to work anywhere while earning money to more than avoid a location-independent lifestyle since we don't have to stay in places with jobs, which means we can move to cheaper places.
Monthly review: January
Published: 2020-02-03 20:10:15

---
title: Monthly review: January
published: true
date: 2020-02-03 00:00:00 UTC
tags: 
canonical_url: 
---

## Sponsors

I’m incredibly thankful to the following people for sponsoring my open sourcework this past month: [@repi](https://github.com/repi), [@oli-obk](https://github.com/oli-obk) and [@yaahc](https://github.com/yaahc).

If you like what I’m doing and want to support my work, please [consider sponsoring](https://phansch.net/thanks) :heart:

## What I’ve worked on

The most interesting thing is probably the addition of a [glossary to the embedded book](https://github.com/rust-embedded/book/pull/223). I’ve been [starting with some embedded development](/2020/01/14/exploring-embedded-rust-part-1/) and have been reading through the existing documentation to look for improvements.

Another interesting thing, if you’re contributing to Clippy, is some streamlining around Clippy’s developer tooling: [I replaced a shell script with a cargo alias](https://github.com/rust-lang/rust-clippy/pull/5109) to make contributing easier if you’re on Windows.

## Reflections & Goals for February

**This January** I’ve unsubscribed from Clippy repository because I couldn’t deal with all of them anymore.

<center>
<blockquote data-dnt="true" data-theme="dark">
<p lang="en" dir="ltr">going to try and unsubscribe from all rust-lang/rust-clippy notifications and instead schedule fixed times for doing PR reviews</p>— #[clippy::phansch] (@philhansch) <a href="https://twitter.com/philhansch/status/1215898420566745088?ref_src=twsrc%5Etfw">January 11, 2020</a>
</blockquote> <script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> 
</center>

I have found it increasingly exhausting to try and react to every GitHub notification. While I admit that it’s not required to _respond_ to every notification properly, I was also feeling bad about constantly marking notifications as done from my side even though they really weren’t done from the other person’s perspective. When I came to that realization, I decided to unfollow the repository and instead assign fixed time chunks for reviewing PRs.

At the end of the month I unfortunately caught a cold and I’m still partly recovering from it. Still, I think since unsubscribing from Clippy notifications I’ve gained back some of my previous momentum.

For this February I have the following goals:

- Actually starting with embedded development, using the discovery kit
- A second embedded rust post
- [Improving a diagnostic](https://github.com/rust-lang/rust/issues/56982) in rustc
Angular Dependency Injection Infographic
Tags: angular, dependencyinjection, infographic
Published: 2020-02-03 00:00:00

---
title: "Angular Dependency Injection Infographic"
author: Chris Kohler
date: "2020-02-03"
hero: "https://raw.githubusercontent.com/ChristianKohler/Homepage/master/content/posts/2020-02-03-infographic-angular-di/images/hero.jpg"
cover_image: "https://raw.githubusercontent.com/ChristianKohler/Homepage/master/content/posts/2020-02-03-infographic-angular-di/images/hero.jpg"
published: true
secret: false
canonical_url: "https://christiankohler.net/angular-dependency-injection-infographic"
masterid: 20200203
excerpt: A graphical overview over Angular Dependency Injection.
description: A graphical overview over Angular Dependency Injection.
tags: angular, dependency injection, infographic,
---

Angular has its own dependency injection framework. It's very powerful and helps increase the efficiency and modularity of your application. It can also be quite complex when compared to traditional DI frameworks.

[The official documentation](https://angular.io/guide/dependency-injection) is very well written and a must read for every Angular developer. The only thing missing for me was a good graphical overview. This is why I created this infographic poster.

👩‍🚀 Protip: 🖨 Print your DI poster and hang it in the toilet. Within a few weeks your work colleagues are DI experts 😀

✅ Also feel free to use the poster for education purposes like workshops or in classes.

👆 It took me hours to complete this cheatsheet. If you like it follow me on [twitter](https://twitter.com/kohlerchristian) and spread the word 🙌

🤓 Did you find a mistake? Please help improve the infographic and open an issue [here](https://github.com/ChristianKohler/homepage)

[Download Angular DI Infographic as PDF](https://raw.githubusercontent.com/ChristianKohler/Homepage/master/content/posts/2020-02-03-infographic-angular-di/angular-di-infographic.pdf)

![thumbnail](https://raw.githubusercontent.com/ChristianKohler/Homepage/master/content/posts/2020-02-03-infographic-angular-di/images/poster-thumbnail.png)

[Download Angular DI Infographic as PDF](https://raw.githubusercontent.com/ChristianKohler/Homepage/master/content/posts/2020-02-03-infographic-angular-di/angular-di-infographic.pdf)

## Update 20.02.2020

- Added providedIn: Module example
- Simplified Provider Syntax (removed string tokens)
- Minor design improvements
Front end Developer blogs to follow in 2020
Tags: developerblogs, sharing
Published: 2020-02-04 07:37:10

---
title: Front end Developer blogs to follow in 2020
published: true
date: 2020-02-03 00:00:00 UTC
tags: developerBlogs,sharing
canonical_url: https://yogeshwaran.in/developers-blog-you-must-follow-in-2020/
---

Hey guys

After a too enthusiastic first ‘new beginning’ post. i don’t have any new ideas or i didn’t do anything apart from my regular office work to blog a post. so in order to break the ice. I would like to introduce some of the best developers blogs i follow.

## Dave cedia

React Guy. He writes mostly on react,redux,svelte and everything frontend. He runs couple of courses on react Pure react and pure redux. Follow him on

[https://daveceddia.com/](https://daveceddia.com/)

## Florin pop

Florin pop is well known for his challenges. He is a inspirational front end developer who blogs mostly on frontend. He recently completed his 100 days 100 project [challenge](https://www.florin-pop.com/blog/2019/09/100-days-100-projects/). currently he is working on 30 days 30 video challenges. i am always wonder how he work on these apart from the regular work.

[https://www.florin-pop.com](https://www.florin-pop.com/)

## Tania rascia

Tania rascia is a full stack developer. She blogs mostly on modern javascript,css and everything frontend. She also Won 3rd place for [Personal Developer Blog of the Year 2019 - Hackernoon.](https://hackernoon.com/personal-developer-blog-of-the-year-hacker-noon-noonies-awards-2019-hz2tu32ql)

[https://www.taniarascia.com/](https://www.taniarascia.com/)

## Chris ferdinandi

Vannila javascript expert. Chris runs couple of [training programs](https://vanillajsacademy.com/) on javascript. His [developer tips newsletter](https://gomakethings.com/articles) is read by over 7000+ develooper each day/.

[https://gomakethings.com/](https://gomakethings.com/)

I will introduce more blogs to you over the time because sharing is always caring.
Makers Week 10: Solo Challenges
Tags: makers, ruby, tdd
Published: 2020-02-02 23:36:28

Weekly Goal:

*Can you solve a challenging technical problem by writing well-crafted code?*

We started individual challenges this week, the main thing we focused on was the process so making sure we were doing our test first and following the single responsibility principle.

Day 1

I wasn't well at the start of the week but I knew we were doing tech tests so I look into some tech tests so I'd know what to expect. 

Day 2

On day two I got started on the bank statement task which and to be able to make a deposit and withdrawal as well as view your bank statement. The way I decided to start this problem was to start by making everything in one class then breaking it up into smaller classes. After that, I moved on to writing my first test which was easy enough. I managed to get it working and passing the acceptance criteria. But I know I had to break it up into smaller classes because of the single responsibility principle.

Day 3

On this day I had to split my class up I decided to split it into two classed first and then break that up into smaller classes if I needed to. I found this to be quite tedious because after splitting them into I would then have to split the tests as well. I would also have to refactor some of the tests that used methods that were being moved to the new class.

Day 4

I had to still split my classes more because they were doing too much. I split each of the two classes I made into two smaller classes. This made my classes significantly easier to read. It also meant that I was following the sing;e responsibility principle which was in part the point of this week making our process better.

Day 5

At the end of the week, I noticed something weird, my tests were only passing if all the quotes were single quotes (') or they were double quotes ("). I found out that when the output was in single quotes the *\n* wasn't being processed into a line break. I also started adding mocks and doubles to my test but I didn’t get that done.

Summary

This week went well although if I were going to do it again I would split the classes up early on, but I know that is the better way to do it I just wanted to challenge myself a little. Next week we start our final projects so hopefully by next week I'll be halfway through creating a game.
How to ask for help in programming
Published: 2020-02-02 23:05:19

Jumping from problems to problems, bugs to bugs, but are some actually bugs or just lack of understanding of concept?

Many have run into problems while coding especially due to misunderstanding of the core concept of a language/tool, libraries or frameworks.

Here I will state some things to do before you actually ask for help. Think of this as a helpful guidepost rather than an iron set of rules.

1. Understand the concept
Try as much as possible to understand how things are working, why they are built, how does it really works? what are the scenarios for implementation? what are the loopholes? Will the technology be helpful in my project?

2. Find a substitute for tools, libraries or frameworks
This will help you understand more of what you are trying to work with. A lot of people write about technologies, the concepts, the pros and cons, substitute, which technology for what solution.

3. Implement/test the technology in a small project to understand it better, for example Dependency injection (DI), you will need to implement it in a smaller project to understand its core principle.

4. Implementing the technology in some part of a bigger project to understand how it will work, implementing it all over might bug your project and leave you with the stress of reverting to previous tools. Thanks to version control systems like git, this should not be an issue.

5. Ask for help.
This is vital. Seek help from your immediate community (remote or physical). Has someone gained an understanding about the technology? If they have, have they used it? If they have used it,  have they run into your kind of problem? If yes how did they solve it? Sometimes they might find it hard to understand your issue, so you need to explain yourself, your thought process, and what you’ve already tried to solve your problem thus far. Be aware that sometimes the answers especially from experts won't be straight forward, they will explain the fundamental concepts and use example scenarios. In the long run, this will be more helpful to you, even if it’s frustrating in the present.

Here are some takeaways for you:
1. Know your subject before you ask for help
2. Don't expect straight forward answers
3. Present a standing ground for someone to help, make sure your made an effort before asking.
4. It is completely normal to ask for help
5. Try been up-to-date with technology
6. Be as clear as possible

Thanks to @mustaphagarba and @auwalms for looking over this article
netsh int ip reset - for when you don't need to know what the problem was
Published: 2020-02-02 22:55:20

There is something to be said for finding the problem and fixing it. And there is also something to be said for hitting it with a hammer until it works/fits.

I use this command in the latter category. 

`netsh` is an amazing command that is a complete toolbox for the Windows networking stack covering most areas of functionality in numbing nuance. It is for this reason that when things go wrong, this is the command that will fix it or tell you what is going on.

That's all well and good, except you don't always have time and patience for finding the problem, and often, a quick fix is just what you need.

`netsh int ip reset` is a *mostly* safe reset of the whole network stack. I use it to fix connection problems with WiFi, DHCP lease problems, and VPN connections that refuse to connect. After a quick reboot, the issues are mostly fixed for me.

This magical command isn't going to fix any real problems like an unplugged cable for an internet issue; it's good for those times when things should be working and you can't see why. Use it like a hammer.
Reasons to Write 📝
Tags: productivity, career, writing
Published: 2020-02-02 22:46:17

_Note: This first blog post is a reminder to myself as to why I have decided to write a blog. I hope it's helpful to other people here also!_

I have been meaning to start writing a blog for some time and finally this is the first post! My [SMART goal] (https://en.m.wikipedia.org/wiki/SMART_criteria) is to publish a post every other week. My reasons to write are:

👶🏻 _For my past self_: To share things that I have learnt with the developer community, especially when I tried to find an article to help me and didn't find exactly what I needed.

👩🏻‍💻 _For my present self_: If you cannot explain something, you do not understand. Although it's [uncertain who actually said this](https://skeptics.stackexchange.com/questions/8742/did-einstein-say-if-you-cant-explain-it-simply-you-dont-understand-it-well-en) this quote definitely resonates. I learn better when actively taking notes and trying to explain things rather than simply reading. I hope that by explaining to others, I also benefit myself indirectly. 

👵🏻 _For my future self_: As developers we are constantly learning, and only a finite amount of information can actually fit into a single brain. I want to write so that my future self can refer back to what I have written and easily relearn what I had learnt in the past. 

I've made a conscious effort here to have the goals focus on myself and what I can control (known as [process goals](https://alifeofproductivity.com/creativity-set-process-goals/
)), rather than who or how many people read my posts or other "success" factors, because even if no one reads what I write, the writing itself is worth it.

If you're interested in even more motivational words, I was super inspired by:
{% youtube nomw8qlGIM8 %} to finally start writing and define my "why", and
{% link practicingdev/a-dozen-ways-to-make-time-2c5m %} to actually make the time to do it (this post was written in the small moments of my week in between doing other things).
Next.js Server Side Rendering and getInitialProps Intro
Tags: javascript, react, nextjs, tutorial
Published: 2020-02-02 22:38:00

---
title: Next.js Server Side Rendering and getInitialProps Intro
published: true
description: A video about how server side rendering works with Next.js and how to properly use its getInitialProps lifecycle function
tags: javascript, react, nextjs, tutorial
canonical_url: https://codebushi.com/nextjs-server-side-rendering
---

We take a look at the power of Next.js and how it handles fetching data using getInitialProps. We also cover some of the gotchas when working with server side rendering since the code runs on both the Node server as well as the Client/Browser.

{% youtube tgS4YsgqLRo %}

4:35 - Pages without the getInitialProps function will be considered by Next.js as a Static Page. If all of your pages are static, you can essentially use it as a static site generator.

5:34 - Code in Next.js will be run both on the server side as well as the client/browser side. Trying to use something like window.location will fail on the server side because the window object only exists on the client side.

8:33 - In order to fetch data using getInitialProps, we need to use the 'isomorphic-unfetch' package because that will work on both server and client.

10:05 - When using getInitialProps, the object that is returned will end up as props in the React component. The props will also include the url object.

11:33 - When visiting a page in Next.js directly, it will fire getInitialProps on the server and the data will be fetched on the server. If, however, you route to the page using the <Link> component, the data will be fetched in the browser.

13:14 - The fetched data from getInitialProps will show in when you view the web page's source code. This is the main reason to use the Server Side Rendering powers of Next.js

16:00 - When building the site, Next.js will automatically determine if a page should be static or server side rendered. If you have any pages with SSR, then you'll need to deploy a Node server in order to host the site.

19:54 - You don't have to use SSR. If you don't need the getInitialProps function and want data, you can use traditional data fetching methods like useEffect or fetch on componentDidMount.