teleren/devto huggingface dataset:
A Beginner trying to understand and use node by doing a project 
Tags: node, beginners
Published: 2019-10-02 11:00:30

---
title: A Beginner trying to understand and use node by doing a project 
published: true
description: I am a student trying to understand what node does and how it works. 
tags: nodejs, beginner. 
---
##Hello,
This is probably super random for me but I decided to create a simple node js project. My classmate had seen me using php ,*he doesn't hold php in high regard*, recommended that I use node. He believed that javascript isn't going anywhere and recommended nodejs.
###The Hand Dealing
I decided that since I had seen node around various blogs and videos whats the harm in actually trying. So, *after a few installations and plugins for vs code later*, I have node set up and will create a simple news applicaiton for financial news (not something big but still...). This will allow things like requesting apis for the news and maybe a few stock tips. An update will be done hopefully every week and I hope to receive helpful feedback and criticism.
**The repo will be added later for those interested**.
Have a good day :)
Lessons from Netflix, Systems Thinking for New Coders, and Code Sharing Overheads
Tags: beginners, microservices, todayilearned
Published: 2019-10-02 11:00:22


*My TL;DR style notes from articles I read today.*


### [Lessons from Building Observability Tools at Netflix](http://bit.ly/netflix-tools)

- Persistent log storage doesn’t scale. Work on an architecture that lets users stream logs into memory & keep the ones that match their criteria. 
- In a microservcie architecture, knowing what decisions microservices are making & how those correlate is critical. Users need this additional context to find the root cause of issues that involve multiple systems. 
- Defining actionable alerting, beyond just threshold alerting, is key to system success at scale. 

*[Full post here](http://bit.ly/netflix-tools), 9 mins read*

----

### [Systems thinking as important as ever for new coders](http://bit.ly/new-coder-thinking)

>*“Drive a Honda or a Jeep, you'll still need to replace your tires and think about the road you're driving on, on the way to the grocery store.”*

Understand how a system works, what are its constituents, how these constituents operate individually and how they interact with other components within your system's context. Know how these components behave when they share, send or request information from other components of the same or a different system. Build a solid understanding of the basics. You can learn any syntax later. That’s the easy part. 

*[Full post here](http://bit.ly/new-coder-thinking), 4 mins read*

----

### [The (not so) hidden cost of sharing code between iOS and Android](http://bit.ly/dropbox-code-sharing)

Dropbox team discovered that writing code once sounds great in theory but over time it leads to overheads that end up being more expensive than just writing the code twice. Overheads of:
- custom frameworks and libraries
- custom development environment
- addressing differences between the platforms
- training, hiring, and retaining developers

*[Full post here](http://bit.ly/dropbox-code-sharing), 7 mins read*

----

*I share these TL;DR versions of articles on software engineering that I read every weekday through my newsletter - [in.snippets(). Sign up here](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is) if you liked what you just read.*
Cross-post from Medium
Tags: help, discuss, blogging, writing
Published: 2019-10-02 10:55:07

Hello. I've written my original article at Medium. Now I want to post it at Dev to but don't want to have a bad influence on my SEO. As I understand, I should use Canonical URL, right? But when I add it in front of my article and save it, I do not see "originally published at" in front of it. How can I solve this issue?
How to subscribe Zong internet Packages
Tags: mongodb, githunt, blockchain
Published: 2019-10-02 10:53:00

How to subscribe Zong internet Packages: If you are looking for how you can subscribe any [Zong net package](https://www.idreesshareef.com/zong-internet-packages/). Then, you are at right place. Here, I will tell you how you can subscribe these packages.

Zong provide you high speed internet in Pakistan. Zong provides you 4G internet speed. If you don''t know how to subscribe Zong internet package, then stay with us.



#How to subscribe Zong internet Packages



#By Phone Pad
First of all you need to open you phone pad.
Dial *6464#
Now you will get a list of many packages with categories.
If you want to check the list of packages according to category. You need to reply with the number with the name of package category.
Now you entered the list of packages with category. You need to select one. Now also reply with the number there.
After you selected the package. Now you will get the values of subscribe of unsubscribe. Reply with number there.
Now you will get the message from Zong for the subscription of package.
Now check your Data by dialing *102*1#. You will get a message with your remaining data.
#By website:
If you want to subscribe using website. Then visit the official website of Zong.
Now select the package you want to subscribe.
Now enter your number.
Now continue the process.
After all process done. Check by dialing *102*1#.
#By SMS:
Zong allow you to subscribe to any zong internet package using sms. There are many SMS you need to send. In return you will ask to subscribe or unsubscribe. You need to send you answer. After that you will need to check you data dialing *102*1#. And get know about how many data left.

#Conclusion:
So, that was all about "How to subscribe Zong internet Packages". If you liked this article then, don't forget to share this with your friends and others. It will appreciate my effort.
My first PR
Tags: hacktoberfest
Published: 2019-10-02 10:45:13

---
title: My first PR
published: true
description: My First ever PR for Hacktoberfest
tags: Hacktoberfest
---

I've finally made my first ever contribution to an open-source project.  I did it because it is something I've always wanted to start doing and never done, but this month mainly for the Hacktoberfest t-shirt!

It was an [issue](https://github.com/strapi/strapi/issues/4133) flagged on the [Strapi](https://strapi.io/) GitHub page.  I picked it because I might be using Strapi in an upcoming project, and more importantly, it looked easy to tackle but wasn't something as trivial as a documentation fix.  Best of all, the PR was accepted and merged the same day by none other than Strapi's co-founder.  I've made it!  Watch out, Linus!  If anyone needs a single word on a single line of code changing, I'm your man.

If you're struggling to find a good first Hacktoberfest PR like I was, I'd recommend choosing a project that has good concise documentation and a guide on how you can set up your development environment to get started.  Also, something you've used or know in some capacity.  While searching and looking at the "Good first issue" tags I found myself being sidetracked trying to work out what the project actually did or looked like.  I'd then get bored and move onto the next project.  

I'm a procrastinator of epic proportions, so it felt good to actually do something!  Now onto the next three issues...
Share your tips and stories with OpenAPI
Tags: discuss, productivity
Published: 2019-10-02 10:19:44

When it comes to a good project management software, there's no perfect solution. 

I myself prefer a project management software that does not have heavy features, instead, they offer OpenAPI for contributors and developers to integrate different apps with their platform. 

Recently, Quire released their [OpenAPI](https://quire.io/dev) - in case you don't know, Quire is a completely free project management software designed for small teams - and I'm working on integrating my own humble time tracking app with their platform. 

I'm very excited, however, it's very challenging since I'm just a junior dev. 

Do you have any tips or inspirations for people who are working on integration with OpenAPI?
How I used Python to solve declareless encoding madness
Tags: python, github
Published: 2019-10-02 09:36:12

There is a very old issue regarding "encoding detection" in a text file that has been partially resolved by a program like [Chardet](https://github.com/chardet/chardet).

Nowadays, one could argue that this issue is not actually one. Indeed, most standards are providing a way to declare the encoding, like in HTTP specifications.

But the reality is different, a huge part of the internet still have content with an unknown encoding. One could point out subrip subtitle (SRT) for instance.

![SRT Madness](https://thepracticaldev.s3.amazonaws.com/i/qhq364rdgznev2belwmw.gif)

This is why a popular package like [Requests](https://github.com/psf/Requests) list Chardet as a requirement to guess apparent encoding on remote resources.

But there is a catch. First of all, libraries like Chardet are unreliable, unmaintained and sometime even disliked publicly by their owner.

Nearly all popular libraries are using the same idea, for each code page or encoding they want to detect they create a specific probe. They are trying to identify originating encoding.

The first thing I did not like is the idea of single prober per encoding table that could lead to hard coding specifications. Secondly, I am convinced that we should not care about the originating encoding, that because two different tables can produce two identical files.

This is where I came with an alternative. **A crazy one :** Using brute-force to get sense out of a given content. For each encoding there is.

  - Exclude encoding that does not fit content at all
  - Measure observable chaos once opened, identify things like "жГЪСЭ Ян"
  - Measure coherence by letter appearances frequencies

By not creating specific probe per encoding I was able to provide detection for around 90 encodings ! That's more than twice compared to Chardet and it is actually more reliable.

![Features](https://thepracticaldev.s3.amazonaws.com/i/10ummszb2fjzk1w5cwu1.PNG)

So I present to you [Charset Normalizer](https://github.com/Ousret/charset_normalizer). The real first universal charset detector. Or if currently busy or whatnot, try it online via [this url](https://charsetnormalizerweb.ousret.now.sh/)

![Demo](https://thepracticaldev.s3.amazonaws.com/i/54lzk6vbi0u8le6v1aw8.gif)
Как организовать уборку снега с помощью JavaScript
Tags: javascript, программирование, кодинг
Published: 2019-10-03 10:47:29

---
title: Как организовать уборку снега с помощью JavaScript
published: true
date: 2019-10-02 09:21:46 UTC
tags: JavaScript,Программирование,Кодинг
canonical_url: 
---

Казалось бы, зима еще далеко, да и при чем здесь JavaScript? Честно говоря, речь не совсем о языке программирования. Оказывается, уже есть [построенные по принципу Uber приложения](https://www.producthunt.com/posts/how-to-start-a-snow-removal-business-2), с помощью которых можно гораздо успешнее бороться с непогодой.
Unique reactions to Twitch raids [Live Coding Recap]
Tags: python, twitch, streaming, design
Published: 2019-10-02 08:44:22

## Streamed: 10/1 on Twitch

⭐ **Star** ⇒ [Project Repository](http://bit.ly/DeepThonkRepo)
💜 **Follow** ⇒ on [Twitch](http://bit.ly/nb9kTwitch) and [GitHub](https://github.com/NinjaBunny9000)
🔴 **Watch** ⇒ [Twitch VOD](https://www.twitch.tv/videos/489097524) (replay)

**Topic(s):** Designing new raid reactions: Faking a hack/glitch
**Language(s):** Markdown™ Kappa
**Tech, Lib(s):** [VSCode](http://bit.ly/vscodenb9k), [OBS Studio](https://obsproject.com), [Elgato Stream Deck](https://amzn.to/2nwRpuF) (affiliate link)

## During the stream we...
✔ made first dev.to post ([Stream News!](https://dev.to/ninjabunny9000/stream-news-week-of-10-1-19-1g89))
✔ brainstormed ideas for new raid react
✔ listened to some gud musirk :ok_hand:
✔ tested/Demo'd prototype of raid react

## We also..
✔ confirmed DeepThonk self-aware. Might be SKYNET (shh!)
Detecting Hover and Touch in CSS and JS
Tags: javascript, css, hover, touch
Published: 2019-10-02 08:13:03

It's dead simple to detect Hover and Touch nowadays thanks to Level-4-media-queries.

```css
@media (hover: hover) {
  //Insert Styles for Hover-Devices
}
```

Detection of non-hover-devices:

```css
@media (hover: none) {
  //Insert Styles for Non-Hover-Devices
}
```

For IE11-support, extend the media-query with a IE11-hack:
```css
@media (hover: hover), screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  //Insert Styles for Hover-Devices and IE11 here.
}
```

You can further specify which device you like to target with [pointer](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer):
```css
@media (pointer: fine) {
  //…
}
@media (pointer: coarse) {
  //…
}
```

In JavaScript, the exact same method works thanks to [matchMedia](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia):
```js
const canHover = window.matchMedia('(hover: hover)').matches; //true or false
```
Something fun about `defer`
Tags: go
Published: 2019-10-02 07:56:28

I read this in [Effective Go](https://golang.org/doc/effective_go.html#defer):

> The arguments to the deferred function (which include the receiver if the function is a method) are evaluated when the defer executes, not when the call executes. Besides avoiding worries about variables changing values as the function executes, this means that a single deferred call site can defer multiple function executions. 

At first I got confused: what does that mean by saying "The arguments to the deferred function (which include the receiver if the function is a method) are evaluated when the defer executes, not when the call executes." ? I continued reading this passage and I found this example:

```go
func trace(s string) string {
    fmt.Println("entering:", s)
    return s
}

func un(s string) {
    fmt.Println("leaving:", s)
}

func a() {
    defer un(trace("a"))
    fmt.Println("in a")
}

func b() {
    defer un(trace("b"))
    fmt.Println("in b")
    a()
}

func main() {
    b()
}

// output:
// entering: b
// in b
// entering: a
// in a
// leaving: a
// leaving: b
```
OMG I got more confused. WHY was "entering" printed before "in" ??? I read the passage again and again and finally I thought I revealed what happened under the hood.

`defer` will acutally postpone the **most outer function** if we try to defer multiple functioin executions. In this case, the most outer function is `un` which needs a string parameter so `trace` will be executed to evaluate this parameter. In other words, the deferred function's parameters will be evaluaed **when it is deferred**. Therefore, "entering" is printed before "in". 

Let's try a more complicated example and I'm pretty sure you know the drill:

```go
func main() {
	b()
}

func entering(s string) string{
	fmt.Println("entering:", s)
	return s
}

func entered(s string) string {
	fmt.Println("entered:", s)
	return s
}

func leaving(s string) {
	fmt.Println("leaving:", s)
}

func a() {
	defer leaving(entered(entering("a")))
	fmt.Println("in a")
}

func b() {
	defer leaving(entered(entering("b")))
	fmt.Println("in b")
	a()
}
```
Learning SDL and C++
Tags: cpp, github, beginners, hacktoberfest
Published: 2019-10-02 07:21:36

I'm currently working on learning SDL/C++ and will most likely be using it to build a dice-based rogue-like game I've been planning out for a while. 

I've used/learned programming from working with Unity and Unreal but I'd like to know how it all works "under the hood". Likely this will be creating a lot more work for myself but it's been a wonderful learning experience so far.

I'm involved with #100DaysOfCode community on Twitter (I'm on round 2, day 74 currently... thinking about going for the #301DaysOfCode this time around... we'll see how I feel at the end of this round). Because of this, I program daily and am constantly trying to learn more. I'm definitely addicted to the code!

Hopefully within the next 6 months I will have something to demo as this has been a project I've wanted to see come to fruition for quite sometime and I feel I finally have enough knowledge to see it come to light!

If anyone has any resources (specifically regarding learning SDL / more advanced C++ (I know enough to get myself in trouble haha)), I'd love to have a look!

I just discovered this community after finishing Hacktoberfest so figured I'd write up something about what I'm currently working on!

I also have a blog I just started a couple of days ago where I post my progress as I learn, to anyone who may be interested: https://beeferiksonstudios.wordpress.com/blog/

Hope you are all having a great day/night and happy coding!! \o/
First Hacktoberfest completion!
Tags: hacktoberfest, html, cpp
Published: 2019-10-02 06:59:15

I just finished my very first Hacktoberfest! 

This was a great time and I anticipate doing many more pull requests before the event is over. It was a great way to get me involved in added to the open source community and it feels good to get extra practice in on "real-world" projects!

While I didn't do anything too complicated, I'd never done anything with Git other than my own personal projects. It was great to learn how to contribute and I look forward to participating in more events like this in the future!
Touch Controls are Implemented
Tags: games, javascript, socketio
Published: 2019-10-02 06:51:18

#[bitsofaweso.me](https://bitsofaweso.me/) update

Hi everyone. A lot of people reacted to my Asteroids clone and I really appreciate the enthusiasm.

One of the first questions I got was about the mobile experience.  Today I'm happy to announce that I have implemented the first iteration of mobile controls.

*Open [bitsofaweso.me](https://bitsofaweso.me/) for a preview of the project so far.*

**A quick note for iOS users:**
The experience has been less than ideal due to iOS blocking the full-screen API. I'm still not sure what to do about that, other than writing a native client/app.

Thank you for your time and consideration!
Scope and Self in Ruby
Tags: beginners, ruby, self, scope
Published: 2019-10-02 06:15:30

Ruby was my first step to the coding world. I fell in love with the simplicity and clarity of its syntax, and after that, all I wanted to do was code. But despite how easy Ruby seems, there are some concepts where it can get confusing. 

![confused](https://media.giphy.com/media/h5cjqz8bIHl3RdVc3M/giphy.gif)

Self was one of those concepts. But in order to understand self, we need to understand what scope is. Depending on the scope in which self is being used, self can refer to different objects. 

When writing code, we use the variables, objects, and methods available to us, and call them within the code. These variables, objects, and methods have varying levels of accessibility. This is what we call the **Scope**. Scope is also available in other programming languages. In Ruby there are 2 types of basic scope: Global Scope and Local Scope.

**Global Scope** - it is the scope that contains and is visible in all other scopes. A variable assigned in Global Scope can be accessed from anywhere in the file. These Global Variables begin with $. Be aware that using Global Variables is not always a good idea because they can kill the flexibility and extensibility of your program. Many programmers try to avoid using them as much as possible. 

**Local Scope** - If a variable is assigned in a method, its scope is called Local Scope. The assigned variable is therefore called a Local Variable. The Local Variable is not accessible outside the method because it is bound to the method context in which it is declared.
```ruby
           $i_am_global_variable = "I can be accessed from anywhere"

           def method_name
            i_am_local_variable = "I am not accessible outside this method"
           end
```

**Self** always refers to only one object in a particular place in the program, but depending on that place, the object may be different. After determining which object self refers to, we can understand what scope of the program we are in:	
1. When Self is inside the scope or method of a class, it refers to that class. 
2. In the scope of a method that does not belong to the class, self refers to the object from which this method is called.
3. Self inside the scope of an instance method will refer to the particular instance of the class from which it is called. 
**Note:** initialize method in the class is also an instance method.

```ruby
         class Song
             attr_accessor :name
             def initialize(name)
                @name = name
             end
 
             def self.method_name
                puts "Self inside class method is: #{self}"
             end
 
             def method_name
               puts "Self inside instance method is: #{self.name}"
             end
         end


          hello = Song.new("Hello")
          Song.method_name     #Self inside class method is: Song          
          hello.method_name    #Self inside instance method is: Hello
```
Update Date for 11ty file
Tags: eleventy, 11ty, jamstack, javascript
Published: 2019-10-05 08:18:43

---
title: Update Date for 11ty file
published: true
date: 2019-10-02 00:00:00 UTC
tags: eleventy, 11ty, jamstack, javascript
canonical_url: 
---

In 11ty you can place metadata into a file using the `---` at the top of an article. It took me a while to understand how to do this in 11ty because they call this [Front Matter Data](https://www.11ty.io/docs/data-frontmatter/). Anyway I was able to add some fields but the one I was interested in was adding an update date to my articles so I could latter either order my posts by the last updated date instead of just created as I will be updating content as I go along. Also I could for now just [show this in my articles](https://hiltonmeyer.com/articles/191002-dates-11ty-templates).

My other interest here is to be able to create posts but only show them in the lists based on this date and then the actual article will be "published" or go live on the date I had specified. So I have setup the Front Matter Data using the the YML setup described in the documentation:

```
---
title: Update Date for 11ty file
description: Adding a field to show the last updated date of the article 
date: 2019-10-02
updated: 2019-10-02
layout: layouts/article.njk
tags: 
 - articles
 - vanilla js
 - 11ty
navtitle: Update Date for 11ty file
---
```

I have added title, description, updated and navtitle for usage in other places when using nunjucks to create the static content. The title and description I basically use for creating the card in the list on the [articles landing page](https://hiltonmeyer.com/articles). I now have the update date which I just need to remember to change in the future when I update an article. This also allows me to not always use the files last changed as I might just be tweaking something or making a minor change so I don't want to have it calculated. there is an option to use [Javascript Front Matter](https://www.11ty.io/docs/data-frontmatter/#javascript-front-matter) so I might dig into this in a future post. One thing I'm really interested in doing is getting an [excerpt from my article](https://www.11ty.io/docs/data-frontmatter/#example%3A-parse-excerpts-from-content) to show on the card which I might be digging into also in the future.
How to Install Git on CentOS 7
Published: 2019-10-02 06:01:48

Git is the most popular version control system nowadays. It helps to share and collaborate on software development projects. It is mainly used for source code management. In this tutorial, you are going to learn how to install Git on CentOS 7.

Prerequisites
Before you start installing Git on CentOS 7. You must have the non-root user account on your Server or Desktop with sudo privileges.

1. Install Git on CentOS
To install latest Git in CentOS you will need to enable GIT repository in CentOS. First, create a new file inside /etc/yum.repos.d/ directory using following command. Then copy the lines given below the command.