teleren/devto huggingface dataset:
How I speed up my daily developing in terminal context
Tags: bash, terminal, vagrant, alias
Published: 2019-08-29 21:29:49

As lots of developer I don't want to waste time with typing more than necessary. So, I began to dig a little into bash and the possibilities and got a few alias's and scripts which helps me to speed up regularly tasks from booting up my virtual machine to updating my local git repository.

It's available in a GitHub repository of mine: https://github.com/AMartinNo1/terminal-helper

My most used alias's are:
`alias vup="vagrant up'`
`alias vhalt="vagrant halt'`
`alias vssh='vagrant ssh'`

Thus the alias's don't save much typing it does feels much faster.

Despite these I also wrote alias to quickly cd into projects. If I was working on dev.to it would be sth like:
`alias devto='cd /path/to/repo/'`

Since mid of this week I added a little bash script which automatically updates my master and development branch and then goes back to my working Branch. As I work on a project with multiple people I can quickly update main branches and merge/rebase if necessary. Additional this ensures I always have up to date branches.

```
function gitBranchSimple() {
  git branch | grep "\*" | sed -e 's/* //g'
}

function gitUpdateLocalRepository() {
  currentBranch=$(gitBranchSimple)
  echo "Checking out master...";
  git checkout master
  echo "Pulling latest commits from remote master...";
  git pull
  echo "Checking out develop...";
  git checkout develop
  echo "Pulling latest commits from remote develop...";
  git pull
  echo "Switch back to original branch...";
  git checkout $currentBranch
}
```

Having this in a repository allows an easy sync between devices as well.

How do you speed up your developing?
Touch Skeleton Game
Tags: codepen
Published: 2019-08-29 21:27:53

<p>The Touch Skeleton is a HTML5 game with collie.js. It's a very simple game. You can touch a skeleton and items on the ground. This code works fine on mobile devices. (IE6~10, Firefox, Chrome, Androind, iOS, Windows Mobile)</p>

<p>You can check out more detail information about 
<a href="http://colliejs.org" target="_blank">http://colliejs.org</a></p>

<p>and You can also play this game here
<a href="http://jindo.dev.naver.com/collie/demo/touchskeleton" target="_blank">http://jindo.dev.naver.com/collie/demo/touchskeleton</a></p>

{% codepen https://codepen.io/davidshimjs/pen/wfBhp %}
'60 Days of Flutter: Building a Messenger from Scratch' : Day 15–17 : Implementing Registration Screen using ‘flutter_bloc’
Tags: flutter, android, mobile
Published: 2019-08-29 21:10:47

Put in a lot of effort and explanation into this one to make it beginner friendly. Do give it a read !

https://medium.com/@adityadroid/60-days-of-flutter-building-a-messenger-day-15-17-implementing-registration-screen-using-d3a708d866a9
I created Switch - 🦄 A key combo window manager that lets you zap between your favorite apps lightning fast.
Tags: productivity, electron, showdev
Published: 2019-08-29 20:41:05


# **[Switch](https://ahkohd.github.io/switch-desktop/)** - A keycombo window manager built with `Electron` & `Node.js` with some native bindings using `N-API`.

Switch between your favorite apps lightning fast. (Windows, macOS - Under development)

## Demo ⚡

{% youtube cysVHi-pcxU %}

### [Get It Now 🤞 >>](http://ahkohd.github.io/switch-desktop)

# Features 🔥
- Switch fast between apps.
- Favorite apps loadout each mapped to your <kbd>Num</kbd> keys <kbd>0-9</kbd>.
- A dock to add favs.
- The convenience of use by both ``left`` and ``right-handed`` users with the use of <kbd>Alt-left</kbd> or <kbd>Alt-right</kbd>.

## Feel free to contribute on [Github](https://github.com/ahkohd/switch-desktop) 👨‍❤️‍💋‍👨

> NOTE: Switch works on Windows, macOS support is under development. All contributions are welcomed. 🙌

[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com)
Differences between "null" and "undefined" keywords?
Tags: javascript, webdev, todayilearned, beginners
Published: 2019-08-29 20:11:24

They both represent a <u>empty value</u>.

## **_Difference nr 1!_**

When you define a variable but not assign a value to it, it automatically puts a placeholder which is called **undefined** so you don't have do it manually, JavaScript does it for you.

**Null** means an empty or non-existent value.

**Null** is assigned, and explicitly means nothing. while **undefined** typically means a variable has been declared but not defined yet.

```javascript
var a;
console.log(a);
// undefined

var b = null;
console.log(b);
// null
```

<br/>

## **_Difference nr 2!_**

**Null** and **undefined** are both <u>primitives and falsy values</u>. However **null** is also an object. Interestingly, this was actually an error in the original JavaScript implementation.

```javascript
var a;
console.log(typeof(a));
// undefined

var b = null;
console.log(typeof(b));
// object
```

<br/>

## **_Difference nr 3!_**

As you can see so far, **null** and **undefined** are different, but share some similarities. Thus, it makes sense that **null** does not strictly equal **undefined**.

```javascript
console.log(null !== undefined);
// true
```

But, and this may surprise you, **null** loosely equals **undefined**.

```javascript
console.log(null == undefined);
// true
```

In JavaScript, a double equals tests for loose equality and preforms <u>type coercion</u>. This means we compare two values after converting them to a common type.


_See you soon for more tips !_
One GraphQL API To Rule Them All
Tags: serverless, javascript, jamstack, graphql
Published: 2019-08-29 19:40:24

###With Mesh, all the services you depend on can work together as one.###

We love the JAMstack because it allows us to use the best services for our websites and apps. However, it can take a lot of developer power to combine and organize data across the services and then ensure that data stays in sync. Not to mention, we have to learn the particularities of each API to maintain and scale the app.

**That's why we're building [TakeShape Mesh](https://www.takeshape.io/signup).** Mesh helps you make your JAMstack development painless and efficient by combining data from multiple services, synchronizing changes to that data, and fetching the data critical to your website or app from a single GraphQL endpoint.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/z4szxa5dltt9s1le42p7.png)

An illustration showing the data flow of TakeShape Mesh. It shows a set of web services connecting in to the TakeShape Mesh logo, then connecting back out to devices and endpoints.

##Compose##
Mesh’s composer is simple and powerful. You can now combine and transform data from multiple services into a single API stream. Combining e-commerce with analytics data has never been easier.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/kt2gdm4ljja2fcmzyq6z.png)

##Sync##
Mesh keeps data synced between your services, so a change in one is reflected across all of them. Make each service into a source of truth and simplify your workflows knowing that your Mesh will keep everything in sync.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/t5e17qgs87p22lp671yp.png)

##Fetch##
Mesh makes querying easy by providing a single GraphQL API endpoint for all of the critical data your website or app needs. The mess and bug-fixing associated with many different endpoints is a thing of the past.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/xoapporjwnoaphj06o97.png)
How to return multiple values in ruby
Tags: ruby, vscode
Published: 2019-08-29 19:33:37


You can return <code>multiple values</code> on a method using comma-separated values when you return the data.


Check the example below
```ruby
def multiple_values
  return 1, 2, 3, 4
end
```
Here we are creating a method called <code>multiple_values</code> that return 4 values. Each of them separated by a comma, in this form when we call <code>multiple_values</code> as a result, we will see an array with all these values. So the first one 1 will be at <code>position 0</code> of the array, 2 will be at <code>position 1</code>, 3 will be at <code>position 2</code> and the last value 4 will be at <code>position 3</code> of the array.

Let’s call our <code>multiple_values</code> method
```ruby
def print_values
  values = multiple_values

  _1 = values.first
  _2 = values[1]
  _3 = values[2]
  _4 = values[3]

  p "first - #{_1}, two - #{_2}, three - #{_3}, four - #{_4}" 
  # => "first - 1, two - 2, three - 3, four - 4"
end

print_values
```

###Calling the method
We created a method called <code>print_values</code> that will print the <strong>values</strong> of the array returned by <code>multiple_values</code> method.
As you can see we store the array returned by <code>multiple_values</code> in a variable called <code>values</code>, this <code>values</code> now contain all the values that we returned before. So for this example to show clearly what <code>values</code> contain we created a *variable* for each value of the array. Variable <code>_1</code> called a shortcut method of the array to <code>retrieve</code> the first element of the array even though it will work exactly the same way as <code>values[0]</code>. Then we have the rest of the variables <code>_2, _3, _4</code> to store the remaining values.

In the last line of the method, we print with a custom format the variables. So to make this work don’t forget to call <code>print_values</code> to see what it does.

If you are the kind of person that likes to play with the code. Here is the link of the live version [https://repl.it/@ViriCruz/multiplevalues](https://repl.it/@ViriCruz/multiplevalues)

Feel free to play around with the code.
How to handle BigData?
Tags: bigdata, csharp, mongodb, discuss
Published: 2019-08-29 19:33:27

#Abstract
I'm currently working on a new (exciting 🤩) project. The project contains data storage💾 and analyzation. One of the most important characteristics of this BigData project is data integrity.
Here are the hard facts:
* I'm using MongoDB as data storage
* asp.net core as web service framework
* .net core to analyze/collect the data

There are a few so-called collectors that harvest information from different sources. Those collectors are written in c# and send data to the so-called Raw.Api🌐. The Raw.Api handles the information and takes care to make inserts into the MongoDb collections. Since data integrity is crucial to this project I devided the operations in three steps:

![](https://upload.wikimedia.org/wikipedia/commons/4/46/BigData_2267x1146_white.png)

#Transaction scopes
* The first transaction scope is: every collector must never send incomplete information. As soon as the data is transferred to the API all information must be written all at once into the database collections. Partial inserts are never allowed.

* The second transaction scope is: as soon as the data is dumped into a temporary collection a background worker starts and writes information to the final collection(s). This must again happen in a DB transaction. Partial updates are not allowed. MongoDB 4.2 supports ACID across multiple collections as far as I know.

* The third transaction scope is: the analyzer must read all data at once and work on the information. A partial refresh is not allowed because the data might have been updated in the meantime and this would lead to inconsistent information.


#Handle the data⚙️
There are multiple collectors and every collector sends information every now and then. For example every 5 minutes. One transaction of data consists of approximately 40mb. 40mb x 12 transactions per hour * 24 hours * 365 = ~4tb. That's too much data📚. Therefore every dataset has a specific Data Save Interval for example daily, hourly, etc.
Every new request replaces all the data from the previous request as long as the request is within the same Data Save Interval.
Every document is stored with a "Data Scope" and a collection date time stamp. A "Data Scope" is, for example, a set of data that can be uniquely identified. This could be a domain (www.google.com). The first step of writing information from the temporary collection to the history collection is to delete every document in the same "Data Scope" and in the same "Data Save Interval". This guarantees that if less information was transmitted by the collector (because someone deleted data which is an allowed scenario) the "old" information is deleted. Then every document is inserted into the History collection. The same happens for a Current collection to make sure that access to the current information is faster.

#Analysis
The analysis happens on a base of rules and I'm not yet sure how to do that yet. Is there a great tool or programming language to archive that?

Any ideas or suggestions for this project? I'm happy to discuss 😜
I Learned React now I need practice
Tags: react
Published: 2019-08-29 19:32:29

Hi, I am a new developer (the new guy) and I just learned react and redux. and of course to really get good at something (especially codding) it is essential to do a lot of practice and i have built more todos and cart than React tutorials on youtube, it's now borring***.

I need something more challenging, hopefully including Redux and React-Router.

I just need some kind of list of cool stuff to build.

Thanks a lot.
Line by Line: Stepping into server-side JavaScript from the frontend with a practical project
Tags: javascript, backend, node
Published: 2019-08-29 19:25:55

Here is an example document to move into server side while building something other than "start a server". Moving into server side some students/people have to be scaled up/down so that they can move at a pace comfortable to them rather than completely stopping due to brain freeze. 

The registration/login functionality is common to most class projects so this document serves as the source of truth that can be referred to while porting over the functionality into their own projects.

[This document is being edited unto infinity](https://www.notion.so/kauress/Rider-App-GeoMapstr-Devshop-61bb4d0476784d89bdc041f9f0f8ee7c)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/d0y5uyte9r5ut02hsvye.png)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/1ku9e71po4j1pkovrk5q.png)
Repl.it - Pros & Cons
Tags: replit, pros, cons
Published: 2019-08-29 19:16:38

_This is my first post, so hopefully it will turn out well_

I've used [repl.it](repl.it) multiple times in the past because I used a chromebook and didn't want to convert it to crouton. I found that it was a really good way for coding, in any language. I've used this for a couple months to code my discord bot, [Ratchet](https://github.com/12944qwerty/Ratchet). I've mainly used python for this, but all of the pros and cons should apply for many languages.

All of the languages in these categories are included:![Categories for languages img](https://thepracticaldev.s3.amazonaws.com/i/v1z2ef5ffdkj3c83ns67.png)

|*Pros*|*Cons*|
|---|---|
|This is a web browser application. You don't need to download anything.|You need to be connected to the internet for your code to run at all.|
|Addons are easy to 'download'. Just write their names.|I only know of this for python|
|This can run for a really long time|Not forever though. If you close your computer, it will stop.|
|Auto Saving onto Cloud. You can also download all of the files if you're offline|Doesn't save onto cloud. So, if you refresh....|
|Debugging|I've never tried this feature, so, I don't know any cons...|
|Real Time Collaborating|Currently in Beta|
|A community. You can ask any questions for problems you have with repl or coding|It is not as fast as stack overflow.|
|It also has a console and uses linux|This console is really hard to use, (for me). I couldn't understand how to do bash commands and etc.|

I'll keep updating as I find more. (Or leave a comment for things you find)

_Let me know for anything I can improve on in the future with writing posts. As I said, it is my first post._
Angular Performance: Optimize Angular Change Detection
Tags: angular, performance, javascript, videos
Published: 2019-08-29 18:54:48

---
title: 'Angular Performance: Optimize Angular Change Detection'
canonical_url: 'https://juristr.com/blog/2019/08/ngperf-optimize-change-detection'
published: true
description: 'Angular is fast, but with your help it can be even faster!'
cover_image: 'https://juristr.com/blog/assets/imgs/ngperf/optimize-change-detection.jpg'
tags:
  - angular
  - performance
  - javascript
  - videos
---

_This post has originally been published on [https://juristr.com/blog/2019/08/ngperf-optimize-change-detection](https://juristr.com/blog/2019/08/ngperf-optimize-change-detection). Go to [juristr.com/blog](https://juristr.com/blog) for more content_

---
    


  This article is part of my "Angular Performance Week" series, where I publish a new video each day based on the performance articles on web.dev/angular. Angular is fast, but we can make it even faster. One way is by tuning its change detection system. Let's see how.

<!--more-->



> Note: this article and attached Egghead video lesson are based on the articles on [web.dev/angular](https://web.dev/angular) by [Minko Gechev](https://twitter.com/mgechev) and [Stephen Fluin](https://twitter.com/stephenfluin). Full credit goes to them :thumbsup:

## Angular Performance Series

1. [Route Level Code Splitting](https://juristr.com/blog/2019/08/ngperf-route-level-code-splitting/)
1. [Preload Lazy Routes in Angular](https://juristr.com/blog/2019/08/ngperf-preloading-lazy-routes)
1. [Performance budgets with the Angular CLI](https://juristr.com/blog/2019/08/ngperf-setting-performance-budgets)
1. **Optimize Angular's Change Detection**
1. [Virtual Scrolling for large lists with the CDK](https://juristr.com/blog/2019/08/ngperf-virtual-scrolling-cdk/)
1. [Precaching with the Angular Service Worker](https://juristr.com/blog/2019/08/ngperf-precaching-serviceworker)

Don't miss the other videos [by subscribing to my newsletter](https://juristr.com/newsletter).

## Optimize Angular's Change Detection

Change Detection is the magic behind Angular that automatically recognizes when changes happen. That’s either due to manual triggering or through asynchronous events. Once a change is detected, it iterates through the various Angular Components and triggers a refresh. Usually it is very fast, however - especially in larger apps - it might trigger lots of computations and thus block the main browser thread. In this lesson we’re going to learn how to optimize Angular’s change detection mechanism by **reducing the amount of components it needs to update** and via **pure pipes**.

{%youtube Ki0V0DPCrzQ%}

### Original web.dev article

Wanna read the original web.dev article? [Check it out here!](https://web.dev/faster-angular-change-detection/).
Three things from today - 8/29
Tags: linux, kubernetes
Published: 2019-08-29 18:50:18

#8/29
###Back at it again.

Hello everyone! Hope you're having a great Thursday. I know I am. I have the joy of sharing with you three things I learned or found interesting today.

#####1. What does Kubernetes kube-proxy actually do?
As i've been learning K8s i've been trying to break down each component into quick understandable parts. Today I did a quick dive into kube-proxy.
###So what does kube-proxy actually do?

* Kube-proxy exists as a pod on each node. 
* Kube-proxy manages the virtual IPs for services. 
* In most versions, by default, Kube-proxy uses iptables to do this. 
  * iptable rules interact with the Linux "netfilter" kernel hooks to make 
  * this happen quickly and without much overhead.
* This allows you to use a virtual IP to route service traffic to various backend pods.
* Kube-proxy acts as a watchdog watching the k8s api and if a service changes it updates the associated IPtables rules.

By viewing the logs of a kube-proxy pod you can see which mode you are using:

```
kubectl logs kube-proxy-qfqxk
W0804 15:49:33.304448       1 server.go:198] WARNING: all flags other than --config, --write-config-to, and --cleanup are deprecated. Please begin using a config file ASAP.
I0804 15:49:33.618663       1 server_others.go:148] Using iptables Proxier.
```
Neat!

#####2. [Linux programming interface](http://man7.org/tlpi/index.html) - New book i'm reading
Ok, i'll be honest, having a ton of books at your disposal with a service like Safari leaves you reading the first chapter and really not much else for a lot of books. I'm hoping to actually keep this up and learn a lot of the low level magic that makes Linux work.

#####3. [SafeEyes](http://slgobinath.github.io/SafeEyes/) 👀 - FOSS Linux Eye strain prevention tool
This tool has been really helping my eyes lately. Every 15 minutes it asks you to do things such as stare off into the distance for 15 seconds which helps not only your eyes, but also to take a quick break and empty your mind. I was worried about the context switching, but for me this doesn't seem to impact my productivity negatively, in fact I think it's actually helping.
Personal blog, Dev.to or Medium?
Tags: discuss
Published: 2019-08-29 17:48:42

---
title: Personal blog, Dev.to or Medium?
published: true
description: 
tags: discuss
---

Now that on Dev.to we have a great community, and on Medium you can be rewarded for your articles, does it make sense to have a personal blog?

If yes, do you copy-paste your articles from the blog to the other platforms?
Introduction to Ansible Part 1
Tags: devops, linux, ansible
Published: 2019-08-29 17:43:20


In the next few blog posts I would try to give a brief #Ansible introduction and how to get started with it. 

Of course for the hands on part I'll be using a few @digitalocean  droplets so make sure to follow along!

Part 1:

https://bobbyiliev.com/blog/introduction-to-ansible-part-1

As always if any questions arise feel free to give me a poke, I'll be happy to help!
What is the oddest JavaScript behavior?
Tags: discuss, javascript, languages
Published: 2019-08-29 17:41:19

JavaScript is notorious for its inconsistencies in a lot of areas. It's also powerful and popular and has a lot going for it.

But can we poke fun at weird things? (whether or not the behavior is a good thing in general)

Let's start with an example:

{% stackoverflow 57456236 %}
What is a Unit in unit testing 
Tags: discuss, testing, programming
Published: 2019-08-29 17:33:03

---
title: What is a Unit in unit testing 
published: true
description: 
tags: discuss, testing, programming 
---

What is a unit in unit testing? Is it a class, a function, a method, all of the above?

Is it considered a unit test if we are testing a class without mocking all of the collaborators?
My TOP resources for .NET & Azure
Tags: dotnet, azure, microsoft, cloud
Published: 2019-08-29 16:48:40

This time, I am going to share my TOP resources about .NET and Azure

**General**

**Microsoft Docs**
https://docs.microsoft.com/en-us/

**Microsoft Learn**
https://docs.microsoft.com/en-us/learn/

**.NET Architecture Guides**
https://dotnet.microsoft.com/learn/dotnet/architecture-guides

**Browse code samples**
Get started with Microsoft developer tools and technologies
https://docs.microsoft.com/en-us/samples/browse/

**Azure**

**Azure Architecture Center**
https://docs.microsoft.com/en-us/azure/architecture/

**Azure Application Architecture Guide**
https://docs.microsoft.com/en-us/azure/architecture/guide/

**Cloud Design Patterns**
https://docs.microsoft.com/en-us/azure/architecture/patterns/

**Azure Reference Architectures**
https://docs.microsoft.com/en-us/azure/architecture/reference-architectures/

**Azure Solutions Architectures**
https://azure.microsoft.com/en-us/solutions/architecture/

**Get Started with CosmosDB**
https://www.gotcosmos.com

**Bonus**

**A collection of simple recommendations for decent Web application frontends**
https://roca-style.org

**Semantic Versioning 2.0.0**
https://semver.org/#semantic-versioning-200

**HTTP Status Codes**
https://httpstatuses.com/