teleren/devto huggingface dataset:
Hacking tool for Hot Module Replacement on docker
Tags: javascript, docker, bash, webdev
Published: 2020-03-30 18:23:53

I'm starting a new project and I need to build the frontend for it. I decided to use Vue.js and get back to the frontend for a few days.

I'm very used to work with docker, so I created my container, installed everything on it and started working on it.

After reading some [nice tutorial about vue](https://savvyapps.com/blog/definitive-guide-building-web-app-vuejs-firebase) I started coding until I realized I needed my build to automatically refresh.

After reading about HMR (Hot Module Replacement) with webpack I realized it's was too much of a hassle for my project. I asked a colleague about what else could I use and he suggested using [Parcel](https://parceljs.org/) since it's very straight forward to use.

It didn't work 😒.

For some reason, whenever I changed a file on my editor **Parcel** didn't rebuild my app. I read all the docs and try every workaround without any luck.

I did some testing and the only way it worked was if I did a **touch** on the files from inside the container.

Just to be clear, this is not a problem with **Parcel** but on how the volume it's working on docker and I guess it might have to be with some cache issue.

After all this, finally I ended up building the following tool:

[https://github.com/gdi3d/js-hmr-osx-docker-helper](https://github.com/gdi3d/js-hmr-osx-docker-helper)

> Sometimes HMR tools don't work quite right when using docker on some OS (OSX) with a mounted volume. You change a file and nothing happens, it doesn't detect the change and no rebuild happens.
>
> This hack-script will make sure your HMR tools (webpack, parcel, etc) sees that a file has been changed/created/deleted/etc.
>
> It uses the command touch to update the file from inside the container helping the HMR tools to be aware of the update.

*Photo Credits: (https://instagram.com/burakkostak)[https://instagram.com/burakkostak]*
GitHub CheatSheet I 
Tags: beginners, github, productivity, angular
Published: 2020-03-30 18:20:13

---
title: GitHub CheatSheet I 
published: true
description: 
tags: #beginner #github #productivity #angular
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/x2yjk4cemu8zojg3to3n.png
---

### What is GitHub?
GitHub is a development platform inspired by the way you work. From open source to business, you can host and review code, manage projects, and build software alongside 40 million developers.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6p50v7vaatevtlcfiedl.png)

*Let's get started...*

- If you already have a project in which you would like to add git, then you can turn an existing directory into a git repository using:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gxlapignq7bkrvjb00dy.png)

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

# Branch
- Create new branch:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mzmigvf9vh1z3oa6v2or.png)

- Switch to the specified branch and update the working directory:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ohtyssls9jjzfqct4vwq.png)

- Delete specified branch:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gm7kwd9pvx4vkn2l0gno.png)

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

# Synchronize changes

- Update your current local working branch with all new commits from the corresponding remote branch on GitHub.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/87reco7ubn5oqeh1nojk.png)

- Uploads all local branch commits to GitHub

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bpivfm4va857zkzak7q6.png)

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

# Make changes:

In order to commit your local changes you need to stage them first:

- Snapshots the file in preparation for versioning

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4mf8pzosjbzm5sdvca4z.png)

- You can use the following command to add all your local changes for staging:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/m6lopgb5utz6apwewqjy.png)

- Records file snapshots permanently in version history
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/23tw4ak5npqmu6s0u22b.png)

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

# Pull Request

Once you have committed all your changes you need to create a Pull Request against the repository you want to merge your changes.

Steps to create a Pull Request:

1. Push your local branch to remote repository using *git push*
2. Go to github.com, you will be prompted with your branch name, click `Create Pull Request`. 
3. Once you have approvals on your pull request, it is time to merge your branch into master. 
4. Use `Merge pull request` or `Squash and Merge` button to merge your pull request into the repository.
5. Once merged, your local changes are now available in `master` branch.
From .NET 2.2 to 3.1 – Routing issues
Tags: netcore, aspcore
Published: 2020-04-24 16:15:28

---
title: From .NET 2.2 to 3.1 – Routing issues
published: true
date: 2020-03-30 18:10:32 UTC
tags: .Net Core,Asp Core
canonical_url: https://irina.codes/from-net-2-2-to-3-1-routing-issues/
---

 ![From 2.2 to 3.1](https://irina.codes/wp-content/uploads/2020/03/routing.png)

Having a website on 2.2, I thought that there is about the case to upgrade. Now or never I said. How hard can it be?

I went pretty smooth, by using the -> migration guide..until…. I’ve bumped into routing. I’ve spent a decent amount of time trying to debug the issue, without visible progress.

My issue was that my website had a public side and an Admin area where all the administration magic happens after login.

Changing from `app.AddMvc()` to `app.UseEndpoints()` is pretty easy just by changing this:

```
app.UseMvc(routes =>     {          routes.MapRoute(             name: "areaRoute year",             template: "{area:exists}/{controller}/{action}/{id?}",             defaults: new { controller = "Home", action = "Index" }             );}});
```

to this:

```
app.UseEndpoints(endpoints =>{    endpoints.MapControllerRoute(        name: "areaRoute year",        pattern: "{area:exists}/{controller}/{action}/{id?}",        defaults: new {controller = "Home", action = "Index"}    );});
```

So the real changes in here are the template parameter name to _pattern_, and `MapRoute `to `MapControllerRoute ` and the rest is pretty much the same.

So far so good, but my routes on the Admin area simply didn’t work anymore. Everything on the admin was not accessible, and I got 404 in the browser. This led me to believe that my routes had an issue around authorization. I tried again and failed again, and I gave up.

Fortunately, we still have the option to ignore for now the UseEndpoints and fallback to the old version by setting a single property to false in ConfigureServices.  
`services.AddMvc(options => options.EnableEndpointRouting = false);`  
Now, by setting this you can use the old approach without any issues, just make sure you don’t add the app.UseRouting() by any means.

## Take 2 – try again

Renamed everything as it should be and looked a bit at the order of Midleware imports.

I can say that 3.1 middleware order matters even more than before. You must have

```
 app.UseRouting();
 //anything in between
 app.UseAuthentication();
 app.UseAuthorization();
 app.UseEndpoints(endpoints =>...);
```

My actual issue was that `app.UseAuthentication()` and `app.UseAuthorization()` order was reversed. I can’t tell you why it worked in 2.2, but for sure doesn’t work anymore in 3.1.

After this fix, I was able to have a fully working app migrated to 3.1, and now I use endpoints not routes.

Conclusion  
We knew that order of the middlewares matters, but in this case there is a slight difference. Make sure you have .UseRouting(), any other middleware you need and then UseAuthentication, UseAuthorization, UseEndpoints

The post [From .NET 2.2 to 3.1 – Routing issues](https://irina.codes/from-net-2-2-to-3-1-routing-issues/) appeared first on [Irina Scurtu](https://irina.codes).
Which ERB tag should I use?
Tags: ruby, rails, beginners, codenewbie
Published: 2020-03-30 17:56:58

Learning Sinatra or Rails comes usually with a great deal of excitement for students of Ruby. Finally, you can develop websites. However, what I see time and again is that students are really confused about when to use which tag. Here’s a little help. Follow the chart above, or find a statement below that describes your needs:

![Flowchart](https://dev-to-uploads.s3.amazonaws.com/i/qi9kko95vgpn0iknjaq0.png)

## I need just html tags!
For instance, if you just want to write `<h1>` to create a new header, you don’t need any erb tags. Yay! This is an example of an html tags alone:
```
<h1> Hello! </h1>
```
---
## I need to write more code than html tags and I want this line to be visible!
This, my friend, calls for `<%=`, or, how I like to call it, an “angry squid” (if you tilt your head to the left, you’ll see a very upset squid). Remember it as that the **squid shoots ink when it’s pissed off and the ink leaves visible stains** so whatever you put in between the squid tag will be visible on the page.
For instance, let’s say you have a universe variable and you want to only have its name visible, you’d do it as follows:
```
<%= @universe.name %>
```
---
## I need to write more code than html tags but I don’t want this line to be visible!
Okay, you’ve deserved ice-cream, or `<%` (if you tilt your head to the right, you’ll see ice-cream on a cone). **No one likes to share their ice-cream so it stays hidden**, or, the content of the tags doesn’t show on the page.
For instance, you have a database with many universes and to list them on your index page, you need to iterate over them. You don’t want to have the iteration line visible so you’d wanna do the following:
```
<% @universes.map do |universe| %>
<% end %>
```
---
## All together now!
And, to give you a full picture, you’d combine html, squid and ice-cream tags:
```
<ul>
 <% @universes.map do |universe| %>
  <li> <%= @universe.name %> </li>
 <% end %>
</ul
```
What you see above, is the following:
- you have an unordered list html tag,
- then, you have an ice-cream tag because you don’t want/don’t need its contents to be visible on the page,
- then, you have a list html tag followed by the angry squid tag, which means that its contents will be visible as a list item,
- then you’re just ending the iteration (‘invisible’ line of code),
- and you’re ending the unordered list.

---

Good luck playing with squids and ice-creams!
I Made A Website To Teach Others JavaScript 
Tags: javascript, showdev, beginners
Published: 2020-03-30 17:55:11

---
title: I Made A Website To Teach Others JavaScript 
published: true
description: 
tags: javascript, showdev, beginner
---
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/min0z9mgat78cedeqd4t.jpg)

I've redesigned my basic tutorial site to help beginners learn JavaScript by teaching in an approachable way. I took the lessons learned from a coding bootcamp to help communicate JavaScript concepts.

Here's the website: https://www.howtocodejs.com/
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4lp09eb7rkzjmx5va15u.JPG)
Here's a little about what inspired me to create this site, taken from my about me page:

I’m a hobbyist coder and serial writer. I designed this website and wrote these articles to teach others how to code this mystical language called JavaScript. When I was first learning to code, I was frustrated by the lack of practical articles. The articles that did go in depth usually were too advanced, and the ones that took their time felt shallow. I always wanted to have everything I needed on one website. I wanted articles that were well explained, ones that used good analogies to allow me to visualize the concepts.

I believe this website would’ve helped “past” me. As a Dev Bootcamp graduate who has a degree in English Literature, I believe that I can communicate tough ideas in a way that everyone can understand–be they novice or experienced. Feel free to ask for help, because your voice will only improve this website as it continues to grow. Thanks for reading.

Happy coding, and stay safe

Raji Ayinla.
How to send mail in laravel?
Tags: laravel, laravel7
Published: 2020-03-30 17:44:19

---
title: How to send mail in laravel?
published: true
description: Send mail in laravel localhost with mailtrap
tags: laravel, laravel 7
---
Here is the video tutorial, easy to understand to send mail in laravel

https://youtu.be/jaB2wcPT9aI
I am offering free online sessions to React beginners
Tags: react, webdev, javascript, beginners
Published: 2020-03-30 17:29:21

Hello all! 

So I’m giving away free online sessions to React beginners to provide some guidance. 

I’ve been working with React and related technologies for 4+ years. The related technologies include Redux, GraphQL/Apollo, Webpack, Sass, and many more. 

I used to be an interviewer at my previous job so I got the chance to interview around 100 devs. The interviews mostly covered topics from Javascript, React and Web Dev in general. 

I’ll give away one session to 3 different people. Each session will include a mock interview and a Q&A section.

If you want to participate just follow me on [Twitter](https://twitter.com/jdelvx) and DM me telling your experience, what do you like about React or Web Dev in general and your goals as a Web Dev. Don’t forget to put a link to your blog or profile from StackOverflow, GitHub or dev.to. 

I’ll announce the 3 winners on Tuesday, April 7th and will DM each so we can schedule the session. 

Why am I doing this? Well, now that we are spending more time at home due to **COVID-19** I just thought it would be nice to chat with other devs, provide some help, do some networking, and also learn from them as well. This way we fight the isolation and create new connections. 

Looking forward to meeting you. 

Thanks!
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2020-03-30 17:13:32

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---
Every Monday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week. ❤️

#1. Sortable & Searchable

Oleksii shows the dynamics (the curvature of the graph) of Сoronavirus distribution per country with their new open source project. Consider submitting a PR!

{% link https://dev.to/trekhleb/i-ve-open-sourced-a-simple-coronavirus-covid-19-dashboard-react-chart-js-bootstraptable-4i49 %}

#2. Perpetual Process

Megan shares how their team stays productive, efficient, and happy in a work-from-home environment.

{% link https://dev.to/mrisdal/kaggle-s-5-remote-first-tips-for-new-wfhers-3a4g %}

#3. How to Commit to Git

Part of their Beginner's Guide to Git series, Gaël walks us through how to write a good commit message.

{% link https://dev.to/gaelthomas/a-beginner-s-guide-to-git-how-to-write-a-good-commit-message-2j49 %}


#4. Run With It

Rose answers the popular questions that come with this main question: "What skills do I need to be a data scientist?" In this post, they share areas, skills, and resources to transition into data science.

{% link https://dev.to/rosejcday/software-engineering-to-data-science-2f5f %}

#5. Music Time

Geoff launches the beta version of their open source plugin that curates and launches playlists for coding right from VS Code.

{% link https://dev.to/softwaredotcom/music-for-coding-50-spotify-playlists-for-developers-41n8 %}

#6. One-of-a-kind

Amruth creates an open-source, free forever resume builder that keeps privacy in mind.

{% link https://dev.to/amruthpillai/ever-dreamed-of-a-free-and-open-source-resume-builder-that-doesn-t-store-your-data-meet-reactive-resume-1dpl %}

#7. No More Training Wheels

Matt encourages people to learn by doing. In this post, they provide useful challenges to practice on while building up your portfolio and confidence as a developer.

{% link https://dev.to/frontendmentor/16-front-end-projects-with-designs-to-help-improve-your-coding-skills-5ajl %}

_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
.gltf and regl 🎥
Tags: javascript, webdev
Published: 2020-03-30 16:57:00

It's been a while, hi everyone, I wanted to share 2 things with you.

3 times now I have attempted to get into webgl through the glsl route. It's hard. If you want something slightly more high level  I highly recommend regl, it's functional for a start which makes it wonderfully ~~compostable~~ composeable, anything in regl should be treated like a component just like react, you have reusable components to define the GL state machine, and you also get props and some reactivity. I am finding gl fun now.

Onto my other descovery, the file format which is being pushed by most people in the GL world. GLTF, what is that? It's flipping JSON! Yes that's right a JSON file format that contains animations, materials, geometry and more! Blender 2.8 ships with the importer exporter and webgl understands this format. I suggest getting some sort of loader for your chosen setup and play around, apparently gltf supports PBR Physically based rendering materials, in other words photo realistic.

So that is my first post in weeks, how did I do? Did you learn anything useful?
100daysofcode Flutter
Tags: flutter, 100daysofcode
Published: 2020-03-30 16:56:16

day 21/100 of #100daysofcode #Flutter
Learning Flutter , courses Udemy from
@maxedapps

Learning about SwitchListTile,some logic, Mapping list,
https://github.com/triyono777/100-days-of-code/blob/master/log.md
The Best Kotlin Resources for 2020
Tags: kotlin, alpas, resources, webdev
Published: 2020-03-30 16:48:50

---
title: The Best Kotlin Resources for 2020
published: true
date: 2020-03-30 16:48:02 UTC
tags: kotlin,alpas,resources,web-development
canonical_url: 
---

This curated list of awesomely-amazing Kotlin resources is brought you by the makers of [Alpas](https://alpas.dev) — the rapid and delightful Kotlin web framework.

### Newsletters and Blogs

- [Kotlin Blog](https://blog.jetbrains.com/kotlin/) — The official JetBrains Kotlin blog. Follow this blog to read it straight from the source.
- [Kotlin Weekly](http://www.kotlinweekly.net/) — Stay on top of Kotlin news with this weekly newsletter that provides links to what’s happening around the Kotlin world. Sign up for their newsletter on their website; or browse through past editions.
- [Top Kotlin Blogs To Learn More In Kotlin](https://medium.com/mindorks/top-kotlin-blogs-to-learn-more-in-kotlin-82a6387e4dd6)

### Learn Kotlin

- [Official Kotlin Tutorials](https://kotlinlang.org/docs/tutorials/)
- [Kotlin Academy](https://blog.kotlin-academy.com/)
- [Kotlin Tutorial](https://www.youtube.com/watch?v=H_oGi8uuDpA) — By Derek Banas, he moves through the basics fast, but this is a very informative video for those who want to have a crash course in Kotlin

### Communities

Kotlin communities abound in 2020. From sub-reddits to Slack, you can surely find a community that suits you best.

- [Official Kotlin Slack](http://slack.kotlinlang.org/?_ga=2.6999218.1253506860.1585508837-1463861314.1579631012)
- [Official Kotlin Forum](https://discuss.kotlinlang.org/?_ga=2.18997048.1253506860.1585508837-1463861314.1579631012)
- [Kotlin sub-Reddit](https://www.reddit.com/r/Kotlin/)
- [Dev.to](https://dev.to/t/kotlin)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/kotlin)
- [Alpas and Ktorm Slack](https://join.slack.com/t/alpasdev/shared_invite/enQtODcwMjE1MzMxODQ3LTJjZWMzOWE5MzBlYzIzMWQ2MTcxN2M2YjU3MTQ5ZDE4NjBmYjY1YTljOGIwYmJmYWFlYjc4YTcwMDFmZDIzNDE)

### List of Lists

These Kotlin resource repositories are the best around. And, of course, most of them are “awesome.” 😎

- [mcxiaoke / awesome-kotlin](https://github.com/mcxiaoke/awesome-kotlin)
- [KotlinBy / awesome-kotlin](https://github.com/KotlinBy/awesome-kotlin)
- [alpas / resources](https://github.com/alpas/resources) — Alpas-focused
- [byecode / awesome-kotlin-android](https://github.com/byecode/awesome-kotlin-android) — Android-focused
- [Awesome Kotlin Resources](https://www.kotlinresources.com/)

### Additional Resources

- [Official Kotlin issue tracker](https://youtrack.jetbrains.com/issues/KT?_ga=2.6463410.1253506860.1585508837-1463861314.1579631012)
- [Official Kotlin Twitter](https://twitter.com/kotlin)
- [Kotlin Talks](https://kotlinlang.org/community/talks.html)
- [Talking Kotlin Podcast](https://talkingkotlin.com/)
Daily Challenge #214 - Persistent Bugger
Tags: challenge
Published: 2020-03-30 16:42:51

---
title: Daily Challenge #214 - Persistent Bugger
published: true
series: Daily Challenge
description: Multiply digits together until there is only one left.
tags: challenge
---
Write a function, `persistence`, that takes in a positive parameter `num` and returns its multiplicative persistence, which is the number of times you must multiply the digits in `num` until you reach a single digit.

###Examples
<pre>
 persistence(39) === 3 // because 3*9 = 27, 2*7 = 14, 1*4=4
                       // and 4 has only one digit

 persistence(999) === 4 // because 9*9*9 = 729, 7*2*9 = 126,
                        // 1*2*6 = 12, and finally 1*2 = 2

 persistence(4) === 0 // because 4 is already a one-digit number
</pre>

###Tests
 persistence(5)
 persistence(52)
 persistence(377)

Good luck!
***
_This [challenge](https://www.codewars.com/kata/55bf01e5a717a0d57e0000ec/train/javascript) comes from joh_pot on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Monthly Recap Newsletter
Tags: newsletter
Published: 2020-03-30 16:37:02

---
title: Monthly Recap Newsletter
published: true
description: Post announcing my monthly recap newsletter
tags: newsletter
---

I’m starting a Monthly Recap Newsletter.

The format will be:

- Things I’ve done which include personal accomplishments, blog posts I‘ve written, and videos I’ve made.
- Things others have done which include blog posts written by others and podcasts I enjoyed listening to.

If you want to get a list of blog posts and videos I’ve made make sure to [subscribe here](https://buttondown.email/appsByMW)! The first newsletter will be sent on April 1st, 2020!