teleren/devto huggingface dataset:
Road to Genius: beginner #5
Tags: javascript, beginners, computerscience
Published: 2020-06-10 06:32:15

Each day I solve several challenges and puzzles from Codr's ranked mode. The goal is to reach genius rank, along the way I explain how I solve them. You do not need any programming background to get started, but you will learn a ton of new and interesting things as you go.

![programming challenge](https://dev-to-uploads.s3.amazonaws.com/i/7utca55980wv0vzys3bt.png)

This is a nice and easy challenge. We are given three numbers (A, B, C), who are then used in a mathematical expression. The result of the expression is stored in variable R.

The buggy line we have is: `let R = (☃️ + B + C) / 💧;`
We also know that R = 5 (it's given), now we have to determine what ☃️ and 💧 should be. Since we have two unknowns but only one equation, we have to make a calculated guess. We see that `A+B+C = 15`. And since R has to be 5, then we can 💧 be 3, which is a possible answer in this case.

Note: we can ignore the `Math.floor(R)` code, it's used for rounding down decimal numbers; since 15 is a whole number it's irrelevant.

![programming challenge answer](https://dev-to-uploads.s3.amazonaws.com/i/28rzrf58evyejbm034sw.png)

Great! On to the next one.

---

If you feel inspired and motivated to upgrade your coding + debugging skills, join me on the Road to Genius at https://nevolin.be/codr/
Understanding Istio: part 6 - Istioctl Tips
Tags: kubernetes, devops, docker, beginners
Published: 2020-06-10 06:28:54

---
title: Understanding Istio: part 6 - Istioctl Tips
published: true
description: Serie of sketchnotes about Istio. Explaining in a visual way Istio principles.
tags: Kubernetes, DevOps, Docker, beginners
series: Understanding Istio in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/obg2jnv2k42w0y3xjhb1.jpg
---

Understanding Cloud technologies, like Kubernetes, can be difficult or time-consuming. In order to spread knowledges about it, I started to create [sketchnotes about Kubernetes](https://dev.to/aurelievache/kubernetes-sketchnotes-pods-4ib0) and know it's time to talk about a perfect companion of Kubernetes, a service mesh, Istio.

We continue our new serie of Sketchnotes about Istio, with a sketchnote about istioctl tips.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/obg2jnv2k42w0y3xjhb1.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/510v4uf2jip5632hyz8k.jpg)

If you are interested, I published a book with all the sketchnotes on Istio (and new ones!): ["Understanding Istio in a visual way"](https://gumroad.com/aurelievache#vJYhM).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
Occupying a seat vs. show me your skill
Tags: cv, resume, career, watercooler
Published: 2020-06-10 06:28:41

_This article has been originally posted on my [blog](http://sandordargo.com/blog/2020/06/10/which-cv-is-better). If you are interested in receiving my latest articles, please [sign up to my newsletter](http://eepurl.com/gvcv1j)._

I'm still not looking for a new job, and - given the circumstances - luckily I don't even have to. Still, after having met some people and having received a couple of interesting propositions I realized that I didn't even have a CV. The latest version I had was 7 years old, something that I used for getting my actual job. Since then I've been eagerly updating my [Linkedin profile](https://www.linkedin.com/in/sandor-dargo/) to document what I've done, but even though I enjoy reading articles about how to craft high-quality resumés I never actually refreshed my CV.

I knew exactly that I'd want a single page resumé and that I'd like to focus on what I have achieved, not what I have done. At the same time, I also remembered a couple of things that [Yegor](https://twitter.com/yegor256) wrote in his 2 cents on how to [pimp up a resumé](https://www.yegor256.com/2016/03/08/pimp-up-your-resume.html).

I know that this thought-provoking guy doesn't value a lot the company where you _"managed to occupy a seat"_, he is interested in about what you do. That's good but I still thought that combining the owners of my chairs and what I've done at those places has a significant value. Especially given that most of my professional activity is related to my workplace, and we don't do a lot of open source code, at least not in my team.

At the same time, I wanted to include some links to my most interesting online appearances, a list of skills grouped by my level of expertise, and my public speaking experience as I've started to speak at conferences and plan to keep doing so.

For my previous position, I managed to put in some numbers as achievements, but not yet for my current job. We lack some statistics, I went with using strong verbs for the moment. Anyways, this is what I came up with:

![My Original CV](https://dev-to-uploads.s3.amazonaws.com/i/dop2kzeiqf0k2wkvmrez.png "My Original CV")

I sent it to Yegor as I was interested in his opinion. He told me that he liked the layout, but he would have preferred to read more about what I do, who I am, and less about the places where "I managed to occupy a seat". Meaning that I should move my jobs to the left part and put my skills and interests to the center.

It felt strange. Okay, to be perfectly honest, it still does. But on the other hand, I realized that I have more technical skills to add, so I could update the previous version too (that's what I included above). So it was definitely worth doing the exercise.

I came up with the below resume and got better feedback for it, though I still prefer the first one.

![My Flipped CV](https://dev-to-uploads.s3.amazonaws.com/i/zwp6sylzqpzkt3n4g1ps.png "My Flipped CV")

What do you think? Which way do you prefer?
HTTP2_Protocol_Error
Published: 2020-06-10 06:26:52

Team

While using https with IIS we are intermittently getting ERR_HTTP2_PROTOCOL_ERROR on Dev tool in Production env.

This works fine with http protocol (QA). We are using IIS 10.

We are using React Framework 16.11.0 version and the fetch method fails.This happens in all the browser (edge, chrome etc) See attchment.

Sharing below the net log data.

{"params":{"description":"Server reset stream.","net_error":"ERR_HTTP2_PROTOCOL_ERROR","stream_id":183},"phase":0,"source":{"id":2567,"start_time":"1619763469","type":1},"time":"1619779275","type":222},

Please let me know if I need to share any other info.

Thanks in advance

Tahir
nvALT revisit
Tags: app, nvalt, mac, gruvbox
Published: 2020-06-10 05:44:15

---
title: nvALT revisit
published: true
description: 
tags: app, nvALT, Mac, gruvbox
//cover_image: https://direct_url_to_image.jpg
canonical_url: https://jma.im/posts/nvalt-revisit/
---
I am looking for an app to do random text input on the macOS, and sync through my own and company's laptops. I tried Tot/Drafts, since I removed my iCloud account on the company's laptop, the only modern way is using Dropbox. 

Then I get back the nvALT after I found it supports backlink, but inside of the app itself, by using `[[text]]`, you can click it to search the nvALT with `text`.

###  Gruvbox Dark Color
Based on [Gruvbox color scheme](https://github.com/morhetz/gruvbox)

Font: [SF Compact Text](https://developer.apple.com/fonts/)  
Search Highlight: `#FE8019`  
Foreground Text: `#EBDBB2`  
Background: `#282828`  

Website: [jma.dev](https://jma.dev/?utm_source=devto)  
Weekly Tech bookmarks: [funcmarks](https://buttondown.email/func)
I was a fan of a minimal atom editor theme so I improved it
Tags: theme, atom, showdev, editor
Published: 2020-06-10 05:42:20

---
title: I was a fan of a minimal atom editor theme so I improved it
published: true
description: 
tags: theme, atom, showdev, editor
---

A lot of people using Atom might know about the Apex theme, the monochromatic color scheme theme that's inspired from IAWriter. It's a really slick theme. The better version is the Apex Slim theme and that theme just aesthetically pleases the crap out of me and I was using it for a while but I updated Atom recently and the theme wasn't really fitting in well with it. (aka broken, the tabs went haywire, etc) 

Instead of creating an issue I just went over, forked it and fixed it while also adding other mods for my usage. 

Now this is only built for macOS because it requires, Atom's Custom Title bar feature enabled. 

As for others, you can just install the normal Apex-UI and you should be good to go. 

[barelyhuman-ui-slim](https://github.com/barelyhuman/barelyhuman-ui-slim)

Check it out and you can raise issues if you have any.
Vanilla JavaScript Check if Date is in the Past
Tags: javascript
Published: 2020-06-10 04:55:35

Now and then you need this function, you want to see if someone's contract or whatever is passed as of today.
So let's see how we can achieve this in `JavaScript`.
We will build a custom function for this so it will be reusable.

## JavaScript Check if a Date is in the Past

In essence we could use [`getTime()`](https://daily-dev-tips.com/posts/vanilla-javascript-get-timestamp/) to get the timestamp, but for instance someones contract must end on this day regardless of the time?

```js
var dateInPast = function(firstDate, secondDate) {
  if (firstDate.setHours(0, 0, 0, 0) <= secondDate.setHours(0, 0, 0, 0)) {
    return true;
  }

  return false;
};

var past = new Date('2020-05-20');
var today = new Date();
var future = new Date('2030-05-20');
dateInPast(past, today);
dateInPast(future, today);
```

I've written down the full function just to explain it better, as you can see we define a `dateInPast` function which accepts two dates.
We then check if the firstDate is [smaller than or equal](https://daily-dev-tips.com/posts/vanilla-javascript-comparison-operators/) to the secondDate. If so it is in the past or today!
We reset the hours/minutes on it so it will be a general day.

Let's now turn this into an [arrow function](https://daily-dev-tips.com/posts/javascript-arrow-function/) for cleaner code:

```js
dateInPastArrow = (firstDate, secondDate) =>
  firstDate.setHours(0, 0, 0, 0) <= secondDate.setHours(0, 0, 0, 0);

console.log(dateInPastArrow(past, today));
console.log(dateInPastArrow(future, today));
```

As you can see much cleaner and quicker!

Feel free to play with this Codepen.

<p class="codepen" data-height="265" data-theme-id="dark" data-default-tab="js,result" data-user="rebelchris" data-slug-hash="KKVdEaE" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="Vanilla JavaScript Check if Date is Past">
  <span>See the Pen <a href="https://codepen.io/rebelchris/pen/KKVdEaE">
  Vanilla JavaScript Check if Date is Past</a> by Chris Bongers (<a href="https://codepen.io/rebelchris">@rebelchris</a>)
  on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Umberto Di Maio - Il miglior cibo per la malattia Cardiovascolare
Tags: cardiovascolare, umbertodimaio, shedirpharma
Published: 2020-06-10 04:50:38

**Shedir Pharma** Per sapere cosa mangiare per ridurre il rischio di malattie cardiovascolari, chiediamo a un esperto, **Umberto Di Maio**, Presidente del Gruppo **Sequestro Shedir Pharma**.

Le malattie cardiovascolari rappresentano un terzo dei decessi a livello globale con malattie cardiache e ictus in cima alla lista. Una delle maggiori influenze sulla salute del cuore e sul suo funzionamento è il cibo che mangiamo. Per guidare il punto a casa, alcuni alimenti possono avere un impatto importante sul funzionamento del cuore, sulla pressione sanguigna, sui livelli di colesterolo, sull’infiammazione inclusa l’obesità. Tutti questi stanno mettendo le persone a rischio di sviluppare malattie cardiovascolari. Pertanto, cambiando le tue abitudini alimentari e conoscendo il cibo giusto da mangiare può ridurre il rischio. Quindi, Umberto Di Maio produce una suddivisione del cibo sano che è necessario per garantire un cuore felice più sano.

Fonte: [Shedir Pharma](https://medium.com/@umbertodimaio/il-miglior-cibo-per-la-malattia-cardiovascolare-59c6753c9c9e)
Sending data to two different fields using foreign key
Published: 2020-06-10 04:50:31

Sending data to two different fields using foreign key


I am using foreign key of a model person using both its field in other other model company. But while inserting data in company I am not getting last name, output is employee and last are both the same.

Class Person (models.Model):

first_name = models.CharField(max_length=30,null=True)
last_name = models.CharField(max_length=30,null=True)

def __str__(self):
    return str(self.first_name)
Class Company (models.Model):

name=models.CharField(max_length=20,null=True)
employee=models.ForeignKey(Person,on_delete=models.CASCADE,related_name='first',null=True)
last=models.ForeignKey(Person,on_delete=models.CASCADE,related_name='second',null=True)

def __str__(self):
    return str(self.name)

ViewSet
class CompanyViewset(viewsets.ViewSet):

def create(self,request):
    name=request.data.get('name')
    employee=request.data.get('employee')
    last=request.data.get('last')
    user=Company()
    user.name=name
    user.employee=Person.objects.get(first_name=employee)
    user.last=Person.objects.get(last_name=last)

    #print(user.last)
    #user.last=use.last_name

    print(user.last.last_name)
    user.save()

    return Response({'Successfully saved'})
Day 29 of #100DaysOfCode: store JWT to HttpOnly Cookie instead of the localStorage
Tags: 100daysofcode, jwt, webdev, backend
Published: 2020-06-10 04:46:16

## Introduction
*100DaysOfCode is a series of articles to record the process of learning programming. It just like a diary. I prefer to write small paragraph or paste a link to details so that I can write everyday.
Feel free to check the link if you want to know more details, thank you!*


I develop an SPA application on Django/DWF recently. I used JSON Web Token (JWT) to authorize users for login and other operations. It’s Okay for me to [create endpoints with JWT secure](https://medium.com/a-layman/build-single-page-application-with-react-and-django-part-3-use-jwt-with-drf-and-tests-endpoints-6a6275fb09d9), [exchange JWT with social medias’ access token](https://medium.com/a-layman/exchange-facebooks-access-token-to-jwt-from-django-drf-server-for-social-login-1bf7d1801cb7).

However, the security issue is a critical issue for JWT. Where should we store the JWT? I tried some ways and wrote this note.

## Details
Please refer to my article for details. 

https://medium.com/a-layman/where-should-we-store-the-jwt-for-spa-memory-cookie-or-localstorage-2491912d8e79

It includes the following topics.
1. The safest place: Browser’s Memory
2. Should we store JWT in the LocalStorage?
3. Double tokens policy: HttpOnly Cookie + CSRF token
4. Summary


## Articles
There are some of my articles. Feel free to check if you like! 
* My blog-posts for software developing: https://medium.com/a-layman
* My web resume: https://jenhsuan.github.io/ALayman/cover.html
* Facebook page: https://www.facebook.com/imalayman
Learning to code clean helped me to cook better
Tags: craftmanship
Published: 2020-06-10 04:23:47

I have heard from my fellow programmers about cooking, the more they are able to handle abstract problems at work, the better they are at cooking. Cooking here in the context is not just about making a tasty dish, but cooking a meal that is tasty, healthy in the long run and maintaining the kitchen well to keep it ready for subsequent meals.

A majority of the us just concentrate on a single (or two or three) nice meal in the taste and quantity aspect as great cooking, but do not see it as a sustainable thing that we will do it on and on. Why I drew parallels with programming is what I learnt at work while coding that was applicable in the kitchen, following are a few.

#### Always leave the code better than how you found it, (Campsite rule).
*Leave the kitchen in a condition that you can cook your next meal immediately. Don’t leave it in a mess for someone else to cleanup.*

####Abstractions help you to concentrate on things as a whole, instead of the simple sum of the parts. You know how things work at ground level as well as how it looks when seen from high above.
*This concept is key to mix and match, new recipes can be born and improvisations based on the abstract taste. Substituting Almonds for coconut, ripe tomato for tamarind. Understanding how things blend with each other makes a good cook.*

####Lessening feedback time, fail fast.
*Taste well, if possible involve another person when trying new dishes. This will help to avoid throwing away a dish cooked for two hours.*

####Use of automations for mundane repeatable things.
*Use electronic devices with timers for mundane activities like boiling milk, water, rice cooking, grilling, baking, roasting, washing so that mind is free to concentrate on things that need attention. Cleaning spilt hot milk due to forgetfulness sometimes takes as much time as cooking a meal.*

####Acknowledge when you don’t know and reach out for expert opinion even if the manual says it to do obvious things.
*Whatever we read about cooking and then scientifically do it, there are still many artistic aspects that needs to be done to be a good cook. Listen to people who cook well and do it as they say.*

####There is a routine that helps, keep it sustainable so that you will come back next day with enough energy to go through that day again and again.
*You can plan a great feast, but then you should give a break to recover to your normal rhythm of running the kitchen. Over time you will learn to cook a lot in a less amount of time.*

####Shortcuts give you that edge, but that is an easy way out that will lead you back into mess again.
*It is very tempting to use taste enhancers, chemical preservatives etc to get most out of our cooking but it will be damaging in the longer run to our health.*

The reverse also is true, those who manage to cook well, will be good programmers.
JavaScript for dummies.
Tags: javascript, dummies
Published: 2020-06-10 04:17:32

#Guía simple, basíca y rapida de JavaScript.#


###Paso 1###
![Alt text of image](https://jarroba.com/wp-content/uploads/2015/11/Abrir-la-consola-de-desarrollo-del-Navegador-Chrome-www.Jarroba.com_.png)

Simplemente abre una ventana/pestaña en tu navegador, presionas el click derecho de tu mouse y seleccionas "inspeccionar elemento"

![Alt text of image](https://tutorialesenlinea.es/uploads/posts/2016-07/1468068960_chorme1.jpg)

Una vez lo hagas se te abrirá esta ventana y allí debes seleccionar en donde dice "consola" 

![Alt text of image](https://pbs.twimg.com/media/EaHzy1xWsAA9FfF?format=jpg&name=large)

Y listo, tienes tu consola del navegador abierta y lista para empezar a codear JavaScript

###Paso 2###

Ahora creemos nuestra primera función, usamos la palabra reservada "function" seguida del nombre que quieras darle y le pasamos entre parentesis a la misma dos parámetros, "num1" y "num2" luego abrimos y cerramos llaves y retornamos usando la palabra reservada del lenguaje "return" la suma de los dos números, luego fuera de la función debemos invocarla, y eso se hace simplemente escribiendo su nombre y entre parentesis escribimos los números que se pasarán a la función , recuerden que ya definimos dichos parámetros y por lo tanto se esperan dos números para retornar la suma.

![Alt text of image](https://pbs.twimg.com/media/EaH0kDqWkAErdoa?format=png&name=small)

También puedes hacer funciones que devuelvan mensajes, por ejemplo en JavaScript existe una propiedad llamada "alert" y lo que hace es mandar un mensaje en forma de "popup" o ventana emergente, puedes usar esa propiedad para pasarle un argumento que se puede almacenar como parámetro.

![Alt text of image](https://pbs.twimg.com/media/EaH3QUZWkAAS1xJ?format=jpg&name=small)

Acá lo puedes ver mejor y entenderlo, y recuerden un parámetro es aquello que se le pasa a una función es decir la variable que la función espera y un argumento es lo que se almacenará en dicha variable o parametro, como en este ultimo ejemplo, el parámetro es "name" y el argumento "SamdyC0de".

Ahora pon en marcha esto que acabas de aprender, simplemente desde tu navegador sin necesidad de instalar nada, haz operaciones matemáticas, envia mensajes de alerta y lo más importante investiga tu mismo y crea pequeños ejercicios para crecer como desarrollador.

                                                             Samdyc0de
TutsWiki - Collaborative tutorials for the Internet
Tags: gftwhackathon
Published: 2020-06-10 03:58:39

[Instructions]: # (To submit to the Grant For The Web x DEV Hackathon, please fill out all sections.)

## What I built

❓Problem: I was unhappy with the low quality tech content on famous websites like TutorialsPoint. We always come across some obsolete content, broken links, or bad practices on tech/programming websites but there's no way to fix that. It becomes the site owner's sole responsibility to keep everything up-to-date. At some point they stop caring about it because they just can't monitor each and every article/link/example on their massive websites.

✅Solution: I made TutsWiki, an open-source platform where people can add or improve the content which is peer-reviewed by the community, so that the resulting content is always of high quality.

❕Example: A CSV file that I used in my example program was broken. The original site which hosted the CSV file had updated the URL along with the CSV content. It was 3 years old content which I was not monitoring but thanks to a visitor who found out about it and raised a PR to fix it. [Link to PR](https://github.com/TutsWiki/source/pull/3/commits/4ea5ecfb9b634d9a0fc04b341e6f316d0a98a875)

### Submission Category: 

Creative Catalyst

[Note]: # (Foundational Technology, Creative Catalyst, or Exciting Experiments)


## Demo
 
https://tutswiki.com/

## Link to Code

{% github https://github.com/TutsWiki/source/ %}

[Note]: # (`{% github https://github.com/TutsWiki/source/ %}`)


## How I built it 

HTML, CSS, JS and GitHub

[Note]: # (HTML, CSS, JS and GitHub)


## Additional Resources/Info 

https://github.com/TutsWiki/

[Reminder]: # (We hope you consider expanding your submission into a full-on application for the Grant for the Web CFP, due on June 12.)
Launch of Aurora for GitHub!
Tags: uwp, github, launch, csharp
Published: 2020-06-10 03:43:58

I made it.

![Store promo image of Aurora](https://github.com/RobbyRobbyRobby/PublicImages/blob/master/AuroraLaunch.png?raw=true)

I had to cut the MVP down to make the #Launch2020UWP deadline of June 9 but I made it.

There will be many updates to add the power features, building upon this base.

Looking at the positive; there will be much room for feedback in the future direction of Aurora and that's exciting!

The Launch article can be [found here](https://medium.com/@Arlodottxt/uwp-community-launch-2020-1772efb1e382)

A direct link to get the free, non time limited no advertising version [is here](https://www.microsoft.com/store/apps/9NNB1JR1TSJN) in the Microsoft Store.

Rob.
Valley Software.