teleren/devto huggingface dataset:
The start of my journey!
Tags: beginners, codenewbie, javascript, todayilearned
Published: 2020-02-10 11:58:23

01.08.2019
That was the day when my "development" journey started!
I will clarify immediately that the only reason why I put "development" in quotation marks is because I still consider myself far from a decent developer.

Being a frontend-dev my journey started with HTML, it was easy. I mean with HTML you don't need to think a lot of super complicated logic. What you see is what you get, so yeah those steps were easy.
After that came CSS, I can't say that it is particularly hard, but some CSS stuff is confusing and misleading. Like I still sometimes wonder: "Do I justify or align here?" when working with flex-box. And some things like gradient transition require hacks to work, but these are very easily available on the web.

But then came the hard part, JS, React.JS...
Here's where things get tricky, here you have to implement logic, use functions and battle Sauron not to get any errors in your console.
For the most part I manage to write the most part of code when I am creating something from scratch and get stuck only at the end and here and there need some refactoring to be done, but the biggest issue for me comes when I battle some already prewritten code. This is where I get stuck.

But I guess the journey doesn't supposed to be easy? Does it? I mean if it would, what would be the point? So yes, even if I do struggle now on things that may not be so hard, I still see how much I have grown personally in the last few months and I still feel that I can grow further in this industry...

TTYS, Mr.Masolov
JavaScript Tip: whatis() — A better typeof
Tags: javascript, tip, webdev
Published: 2020-02-10 13:04:36

Correctly determining the type of a value in JavaScript is not very obvious, especially to beginners. However, using `Object.prototype.toString` has always proven to yield a slightly better result for most values than the native `typeof` operator.

Leveraging `Object.prototype.toString`, we can create a better `typeof` — a function called `whatis()`, like so:

```js
function whatis (value) {
  return Object.prototype.toString.call(value)
    .replace(/^\[object\s+([a-z]+)\]$/i, '$1')
    .toLowerCase();
}
```

**Here, we are doing 3 things:**

- First, call `Object.prototype.toString()` on `value` to get the string tag of the value. The function returns a string of this format: `"[object T]"`, where `T` is the string tag (e.g Array, String, WeakMap, etc).

- Next, use a regular expression and `String.prototype.replace()` to extract the string tag.

- Finally, change the string tag to all lowercase and return the result.

> **Note:**
> _The `whatis()` function is still error prone. Its type testing mechanism is not so reliable for some kinds of built-in or program defined objects, since there are several ways of changing the reported type of an object._

```js
whatis(NaN); // 'number'
whatis(-5.23); // 'number'
whatis(Infinity); // 'number'
whatis(144705209n); // 'bigint'
whatis('hello world'); // 'string'
whatis(Symbol.iterator); // 'symbol'

whatis(null); // 'null'
whatis(false); // 'boolean'
whatis(undefined); // 'undefined'

whatis(/^.+$/); // 'regexp'
whatis([1, 2, 3, 4]); // 'array'
whatis({ x: 5, y: 10 }); // 'object'
whatis(function () {}); // 'function'

whatis(new Date()); // 'date'
whatis(window.location); // 'location'
whatis(document.body); // 'htmlbodyelement'
```

> **Note:**
> _The `whatis()` function will throw a `ReferenceError` for variables that have not been declared, unlike the `typeof` operator that evaluates to `"undefined"` for undeclared variables._

```js
console.log(typeof undeclaredVar); // "undefined"
console.log(whatis(undeclaredVar)); // Throws ReferenceError
```

### Further Reading

1. [typeof - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof)
2. [JavaScript typeof: Understanding type-checking in JavaScript](https://blog.logrocket.com/javascript-typeof-2511d53a1a62/)
3. [Understanding the JavaScript typeof Operator ← Alligator.io](https://alligator.io/js/typeof/)
4. [Typeof | freeCodeCamp Guide](https://guide.freecodecamp.org/javascript/typeof/)


### ❤️ Like and Share

If you found this post insightful in any way please:

- **Like** this post
- **Comment** your feedback
- **Share** with someone
- **[Follow me](https://twitter.com/gladchinda)** on Twitter
The complete gRPC course [Protobuf + Go + Java]
Tags: grpc, go, java, microservices
Published: 2020-02-10 14:51:59

If you're building APIs for your microservices or mobile applications, you definitely want to try gRPC.

It is super-fast, strongly-typed, and you no longer need to write a lot of boilerplate codes for services communication. Thanks to awesome HTTP/2 and Protocol Buffer!

Here's the link to the [full gRPC course playlist on Youtube](https://www.youtube.com/playlist?list=PLy_6D98if3UJd5hxWNfAqKMr15HZqFnqf)
Github repository: [pcbook-go](https://github.com/techschool/pcbook-go) and [pcbook-java](https://github.com/techschool/pcbook-java)
Gitlab repository: [pcbook-go](https://gitlab.com/techschool/pcbook) and [pcbook-java](https://gitlab.com/techschool/pcbook-java)

This is a 4-in-1 course, where you will learn not only gRPC, but also protocol-buffer and backend development with Go and Java. The codes in this course are production-grade, with well-organised structure and unit tests.

# What you’ll learn:
- What gRPC is, how it works, why we should use it, and where it is suitable to.
- The amazing HTTP/2 protocol that gRPC is built on.
- Compare gRPC with REST.
- Write and serialise protocol-buffer messages using Go + Java.
- Define gRPC services with protocol-buffer and generate Go + Java codes.
- Implement 4 types of gRPC using Go + Java: unary, server-streaming, client-streaming, bidirectional streaming.
- Handle context deadline, gRPC errors and status codes.
- Write production-grade application with interfaces and unit tests for gRPC services.
- Use gRPC interceptors to authenticate & authorise users with JWT.
- Secure gRPC connection with sever-side & mutual SSL/TLS.
- Enable gRPC reflections for service discovery.
- Load balancing gRPC service.
- Use gRPC gateway to generate RESTful service and swagger API.

# Are there any course requirements or prerequisites?
- You only need to have basic programming skills in Go or Java.
- You don't need to know protocol-buffer before, since we will learn deeply about it in this course.

# Certificate of completion

This course is completely free. You have full access to all lectures on [our Youtube channel](https://www.youtube.com/c/TECHSCHOOLGURU).

If you like the lectures and want to support TECH SCHOOL, you can do so by [purchasing the course on Udemy](https://www.udemy.com/course/the-complete-grpc-course/?couponCode=B8BB6FCDA52227FDA8FA). 



That would give us a lot of motivation to make more useful stuffs for the community. And in return, you would also get a Udemy certificate of completion.

Thank you for your support and happy learning!

---

If you like the article, please [subscribe to our Youtube channel](http://bit.ly/techschoolguru) and [follow us on Twitter](https://twitter.com/techschoolguru) for more tutorials in the future.

---
If you want to join me on my current amazing team at Voodoo, check out [our job openings here](https://bit.ly/voodoojobs). Remote or onsite in Paris/Amsterdam/London/Berlin/Barcelona with visa sponsorship.
Searching for English Mentor
Tags: help, mentor, english
Published: 2020-02-10 15:10:12

Hi community, I'm actually studying English. I want to improve my communication skills, mainly speaking.

I'm searching for a native English speaker that can help me practicing conversations for 15 minutes.

{% twitter 1226136773417414656 %}

¿Can you help me? ¿or know someone how can do it?

Thanks in advance!
Hey.com / New front end paradigm / What is DHH cooking?
Tags: discuss, rails, turbolinks, stimulus
Published: 2020-02-10 16:23:00


DHH announced last week a very promising new email service from Basecamp

{% twitter 1225487645268160512 %}


Earlier DHH mentioned some new technics for optimizing front end (simpler code/faster)

{% twitter 1212930897357479937 %}

Hey.com is built using this new approach and DHH will present it at Rails conf.

{% twitter 1225504208465670147 %}


What are your guesses?
Become a MERN stack developer
Tags: mongodb, react, node
Published: 2020-02-10 17:11:48

This post was originally written for my website www.easyontheweb.com <- Please check it out.

The goal of this website is to make learning web development easy for everyone. One of the hottest web development stacks these days is the MERN stack – MongoDB, Express , ReactJS and NodeJS. I myself work on the same stack professionally. So, here is a list of 5 resources that can help you become a MERN stack developer.

MongoDb – The Complete Developer’s Guide
Easily one of the best places you can learn about MongoDB. This course teaches you all the ways you can write queries in MongoDB, how mongo works under the hood and even a bit of deploying and managing database servers. A one stop shop for learning everything about MongoDB there is to learn.

The complete Node.js Developer Course
A very very comprehensive and long (40 hours) course that teaches you all that is to learn about NodeJS and express on your way to creating Express APIs and making web applications on Node. The course might be a little long but by the end of it, things do get stuck to your head.

Modern React with Redux
One of the earliest courses that I ever took on React by Stephen Grider who explains everything diagrammatically which is a big plus at least for me. You will build 3-4 react applications using different techniques and methods and will have a good grasp of ReactJS by the end of it.

Advanced CSS and SASS
My senior always said to me – “Never underestimate CSS” and for a long time I did not listen to him which was so wrong of me. The importance of CSS cannot be undermined in web development and to call yourself a full-stack developer you must learn CSS and this is a superb course to do that !

Zero To Mastery 2020
Now that you have mastered all the different things separately I hope this course won’t be difficult for you to go through. This will combine all the different MERN stack technologies and you will learn how to create production ready web applications in this course.
Do you always need the '-u' in git push -u origin master?
Tags: git
Published: 2020-02-10 20:24:11

You have seen this command in many tutorials. Maybe you use it everyday, or every time you push:

```bash
$ git push -u origin master
```

This pushes changes in your local repository up to the `master` branch of the remote repository `origin`. 

But do you need to do this every time you push? 

The `-u` in this command is a short-hand for `--set-upstream`. Using this flag you are basically telling git to automatically link your local master to the remote master. Therefore you only need to do this once. After that you can just write `git pull` and `git push` on master.

Just remember to do this the first time you create a branch locally and are ready to push it to the remote:

```bash
# Create a branch and switch to it
$ git checkout -b bugFix

# Work on bugFix and then commit the changes
$ git add .
$ git commit -m "Put some print statements. Found the bug."

# Since this is the first time you push to origin
$ git push -u origin bugFix
```

This creates a branch called `bugFix` on your remote and sets your local `bugFix` branch to track it. So from now on, when you switch to that branch locally, you can just pull and push without any further argument or flag.

## Pro tip:

If you want to see how your local branches are connected to remote branches, take a look at your repository's config file. The `-u` flag sets the merge property of the branch:

```bash
./my_repo$ cat .git/config
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
	precomposeunicode = true
[remote "origin"]
	url = https://github.com/<your-user-name>/my_repo.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
[branch "bugFix"]
	remote = origin
	merge = refs/heads/bugFix
```

<a href="https://chipper-musician-9131.ck.page/9403a50270">![signup](https://dev-to-uploads.s3.amazonaws.com/i/8ss07lhmjal7jo4lmbpn.png)</a>
My Week With WordPress
Tags: wordpress, plugin, interview, php
Published: 2020-02-10 23:05:16

---
title: My Week With WordPress
published: true
description: My experiences creating a plugin for WordPress with very, very little knowledge of PHP or WordPress
tags: WordPress, Plugin, Interview, PHP
---

## The Mess I've Created

For a recent interview, I was given the challenge of creating a WordPress plugin.  I had only worked with PHP for about a week and I had just gotten WordPress running locally the day before my interview.  (I did tell both of these things to the interviewer.)

I went through the usual phases of my development cycle:

Confidence -> Uncertainty -> Insanity -> Breathe -> Make it Work

![my range of emotions](https://cdn.pixabay.com/photo/2017/11/26/15/16/smiley-2979107__340.jpg)

I had many challenges, beyond just writing unfamiliar code.  I couldn't get my local environment running and under a time crunch, I tried to use a free web host for my testing environment.  (I quickly exceeded their allowances).

## How I Made It Work

After I was locked out of my second free web host, I knew I had to get my local server running.  The WordPress download didn't include any server or database programs, so after a little research I installed [Xampp](https://www.apachefriends.org/index.html) which was very easy to install and use.  

Now I could finally breathe and write some code.  Or so I thought.

## My Not [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) Workflow

My workflow was a frantic, panicked mess.  I didn't have time to dig in and properly learn WordPress.  I just had to make it work and go.  

Here's what I did:
- Write code
- Zip code files
- Upload zip to dashboard
- Install plugin
- Test
- Uninstall plugin
- Repeat

![repetitive workflow](https://cdn.pixabay.com/photo/2014/04/03/10/52/circle-311551__340.png)

Since I didn't have enough time to fully understand WordPress, my workflow was less than ideal and this is why I am writing you.

## Your Suggestions?

So, now that I've made my code work and submitted my project, I'd like to learn how to do it better.  What are your experiences developing for WordPress?  How can I make my processes more DRY (dryer?)?

Thanks for reading and cross your fingers for me getting this job 🤞.
Post Requests in Javascript
Published: 2020-03-02 17:45:19

During the most recent code challenge at Flatiron School's Seattle Campus, it became clear that many students lack a clear understanding of the format for POST and PATCH requests. Let's walk through a simple post request to find out exactly how it works, line by line and step by step. We'll be using an example from one of our in class pair programming exercises. This POST request is to create a new Pokemon in our database.

```function addPokemon(trainer) {
    fetch(`http://localhost:3000/pokemons/`, {
        method: "POST",
        headers: { "Content-Type": "application/json",
                    Accept: "application/json"
                },
        body: JSON.stringify({trainer_id: trainer.id})
    })
    .then(res => res.json())
    .then(data => {
      listPokemon(data)
    })
}```

First we see a 'trainer' being passed into the function. This is because we want to associate the Pokemon we are creating with the trainer who has captured it. 

Next we see a fetch request. This specifies where our POST request will go. We need the result of this fetch before we can proceed with the rest of our request. 

Next we see the method "POST". This specifies the type of request we are making. 

We then come to headers. The headers job is to tell the server what type of data to accept and what to send back. In this case we're telling the server that we will be sending JSON (Javascript Object Notation) and expect to receive JSON back.

The next piece is the line that says "JSON.stringify". This line converts the object we are sending into a JSON string.

Our Post request ends at at this point. In the following lines we are handling the data we get back. We first pass it to the .json function, will receive it as a promise with JSON content.
Back of the Project Aurora napkin
Tags: uwp, ux, xaml, npd
Published: 2020-02-11 02:47:20

Ever hear of a project being drawn up on the back of a napkin?

Well, here's the basic starting 'napkins' for Project Aurora showing what I am and am not interested in.

![Screenshot of GitHub with the bits I'm interested in indicated](https://i.pinimg.com/originals/7d/f4/aa/7df4aad5fd4fe9c2d27107098b389ee4.png)

![Issues in GitHub](https://i.pinimg.com/originals/cd/32/2a/cd322a37776a51092c07ae719223fd52.png)

And the plan from now until the release date in June with the #Launch2020 crew:

![From now to Launch2020 plan](https://i.pinimg.com/originals/81/f2/79/81f279f680daca8eec35795110b76e5b.jpg) 

You can see I have left room for [Spoons](https://play.google.com/store/apps/details?id=com.valleysoftware.Spoons), Onesie (Another concept) and a major feature update for [Kanban Ink](https://www.microsoft.com/store/apps/9P5RSNPRQRMD)

Plus all the other maintenance, of course!
Promise/async関数でthrowとtry~catchはやめておこう
Tags: javascript
Published: 2020-02-11 06:32:16

こんにちは。Twitterで[完全に俺の意見ということが判明しました](https://twitter.com/mandel59/status/1227121199810957312?s=20)が、残しておきます

## async関数の場合
```js
const f1 = async () => {
  return await Promise.reject(new Error("e"));
};

const f2 = async () => {
  throw new Error("e");
};

f1()
  .catch(e => console.log(e));


try {
  f2();
} catch (e) {
  console.log(e);
}
```

さて、間違っている箇所がわかるでしょうか？

実行すればすぐにわかることですが、`async funciton`の中で投げられた例外は`Promise.prototype.catch()`でないと受け取ることができません。そもそもこのような間違いを犯さないためにも、`Promise`の中のエラー送出は`Promise.reject()`を利用すべきです。

## Promiseの場合

前を踏まえれば当然次のようなコードになります。

```js
const f1 = () => new Promise(() => {
  throw new Error("e")
})

const f2 = () => new Promise((resolve, reject) => {
  reject(new Error("e")
})

f1().catch(e => console.log(e));

f2().catch(e => console.log(e));
```

終わり。asyncの中で`throw new Error()`、asyncの利用側で`try~catch`はやめておきましょう。
How to manage and automate environments on Google Cloud Platform?
Tags: google, gcp, terraform, devops
Published: 2020-02-11 10:13:48

---
title: How to manage and automate environments on Google Cloud Platform?
published: true
description: 
tags: google, gcp, terraform, devops
---

In my last article, I deployed a simple front end application on Google Cloud Platform. It was great learning how to use it. But what if the project growths? What if I need to manage multiple environments like `dev`, `test`, `staging` and `prod`?

How to handle all this on Google Cloud Platform? How to automate? [`Terraform`](https://www.terraform.io/) is the answer. Probably. I found this video very useful to understand how `Terraform` can help me in this.

{% youtube HmxkYNv1ksg %}

Any thoughts?
Idea needed 
Tags: idea, sideprojects, javascript
Published: 2020-02-11 11:49:52

Hi guys & girls, 

I really need your help with an idea for a school project (I'm studying Digital Marketing). So, the challenge is to build a digital element (app, platform, advertising campaign, short movie, basically anything as long as it involves a digital aspect) that solves a public problem concerning the whole society. 
I'm comfortable working with JS, mainly React, but open to learning new technology in order to deliver a great project.

Hopefully you have more inspiration that I do :)
I made a Color Scheme for Programming Using Math
Tags: darkmode, theme, dracula, vscode
Published: 2020-02-11 15:36:39

It's been almost 7 years since I launched Dracula as an open source project.

**Today I'm launching [Dracula PRO](https://draculatheme.com/pro).**

## 🤔 The problem

In 2013, my laptop was stolen, so I had to re-configure everything. At that time, there were thousands of color schemes for programming out there, but none of them were appealing to me. So I decided to create my own.

Fast forward to 2020, Dracula is one of the most popular themes in the world with more than 2 million downloads. Still, I felt that something was missing. I wanted to help with **more than just a theme**.

## 🛠 My solution

I decided to create a new color scheme using mathematical concepts to **normalize lightness and saturation**. I also tested the contrast ratio for better visibility on low-light environments.

Besides that, I hand-picked 4 monospaced programming fonts that fit perfectly with the theme. These fonts have **built-in ligature support** that improves readability.

Dracula PRO is everything I know about color schemes, typography, and productivity tips into one package.

## 🧛‍♂️ What do you think?

I would love to hear your thoughts on this. And if you have any questions, please do comment
ActiveRecord & Rake cheatsheet
Tags: ruby, rails, productivity
Published: 2020-02-13 21:20:40

---
title: ActiveRecord & Rake cheatsheet
published: true
description: software engineer bootcamp blog
tags: ruby, rails, productivity 
series: Software Engineer Quick Reference Guides
---
There is a lot to learn when first learning ActiveRecord and Rake. So much so that I created a cheatsheet for myself. This is a quick reference guide for the basic folder structure ActiveRecord (just AR for now) and Rake look for as well as what each file needs to get everything up and running.

## Folder Structure

root.
 ./ < Gemfile >
 ./ < Rakefile >
 ./app
 ./app/models/ < model_file.rb >
 ./bin < run.rb >
 ./config < environment.rb >
 ./db < seeds.rb >, < schema.rb >
 ./db/migrate/ < 001_migration_file.rb >

## Files
For each file there are some basics that each file needs and ActiveRecord. Here is each file as noted above.
1. `Gemfile` - this file lists all gems being used in your app. Note in the line for activerecord it calls to a version number, this is optional. 
    ```ruby
    source "https://rubygems.org"

    gem "activerecord", '~> 5.2'
    gem "sinatra-activerecord"
    gem "sqlite3", '~> 1.3.6'
    gem "pry"
    gem "require_all"
    ```

2. `Rakefile` - this file establishes connections within the folder structure and creates a live environment through `rake console` that allows for testing.
    ```ruby
    require_relative 'config/environment'
    require 'sinatra/activerecord/rake'

    desc 'starts a console'
    task :console do
      ActiveRecord::Base.logger = Logger.new(STDOUT)
      Pry.start
    end
    ```

3. model_file - these are highly specific but the minimum. This file acts as the model that matches a table in the app's database. It is a _good idea_ to keep the name here matched to migration file and table that this model file provides custom functionality to.
    ```ruby
    class ModelName < ActiveRecord::Base
    end
    ```

4. `run.rb`
    ``` ruby
    require_relative '../config/environment'
    ```

5. `environment.rb`
    ``` ruby
    require 'bundler'
    Bundler.require

    require 'active_record'


    ActiveRecord::Base.establish_connection(
      adapter: 'sqlite3', 
      database: 'db/development.db'
      )

    require_all 'app/models'
    ```

6. `seeds.rb` - this file will contain test data that can be loaded into the app's database. Prior to creating the seed data it is a great idea to have a line per model that deletes everything out of the data table for that model. This way the seed data can be reloaded as needed and old data will be removed.
    ```ruby
    Model.delete_all
    ```

7. `schema.rb` - This file is created by ActiveRecord, do not edit it manually but it is good to reference back to it as it will contain the lastest version of the schema for all tables within your database.

8. 001_migration_file.rb
    ```ruby
    class CreateProteinTable < ActiveRecord::Migration[5.2]
      def change
        create_table :proteins do |t|
          t.string :name
        end
      end
    end
    ```