teleren/devto huggingface dataset:
Production-oriented development
Tags: todayilearned, architecture, programming
Published: 2020-03-19 13:00:28

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

### [Production-oriented development](http://bit.ly/39V2Lv7)
 
- Let the engineers who write the code also be responsible for operating it in production: deploying, instrumenting and on-call for monitoring. 
- If you can avoid building something new, do so. Writing code is the most expensive way to solve any problem that doesn’t address a core business need, especially when there are open-source and hosted solutions for small/medium companies that deal with git repository hosting, observability tooling, managed databases, alerting etc., and even infrastructure for Kubernetes clusters and load balancers.
- Make deployment frequent and unexciting: engineers should be able to deploy with minimal manual steps and you should minimize code freezes or blackout periods like ‘don’t deploy on Fridays’. 
- Switch from manual QA gates to automated testing for the deployment pipeline. Have a team for continuous testing in production, and do away with pre-production environments. 
- Choose ‘boring’ technology over bleeding edge tech.  It is least likely to be unpredictable and is backed by the most expertise when you do have to debug, unlike ‘unique’ systems. 

*[Full post here](http://bit.ly/39V2Lv7), 11 mins read*

---

### [Data-oriented architecture](http://bit.ly/3d7lhmm)

- In data-oriented architecture (DOA), systems are still organized around small, loosely coupled components as in services-oriented architecture with microservices. However, the components are always stateless and component-to-component interaction is minimized so that they interact through a data layer instead.
- Common examples that approximate DOA include those using data monoliths where all or most data is persisted in a single store, such as knowledge graphs or GraphQL.
- If you are worrying about scaling your architecture horizontally, you can consider a data monolith at its center and base your decision on these factors: 
    1. Service-to-service APIs are not necessarily ad hoc, but it is easier to pass parameters in direct component-to-component communication.
    2. Beware if your system has integration as a bottleneck, as it will affect growth.
    3. Think hard about data ownership: multiple writers might have to modify the same record so you need to partition write ownership.
    4. Carefully plan the shared global schema because inter-component APIs are encoded in the data.
    5. If services call others with a direct address (like an IP) and know where to reach a particular service from command-line parameters, you need to wrap those better to construct the right flags, depending on the environment (say, structuring each service under a path routed by one server). 

*[Full post here](http://bit.ly/3d7lhmm), 10 mins read*

---

*[Get these notes directly in your inbox every weekday by signing up for my newsletter, in.snippets().](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
Daily Developer Jokes - Thursday, Mar 19, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-03-19 13:00:13

---
title: "Daily Developer Jokes - Thursday, Mar 19, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Thursday%2C%20Mar%2019%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12599ebe62f.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q___: Why can't you use 'Soup' as your password?

___A___: Because it isn't `stroganoff`
 -->
TIL how to fix dependency conflicts with Yarn (and NPM)
Tags: todayilearned, javascript, node
Published: 2020-03-19 12:54:25

---
title: TIL how to fix dependency conflicts with Yarn (and NPM)
published: true
description: How to solve dependency issues with selective dependency resolution.
tags: todayilearned, javascript, node
---

*In case of severe TL;TR please scroll down to the end.*

I started to use [TipTap](https://tiptap.scrumpy.io/) in my Vue project and got some strange issues. Eventually I found out they are being caused by package version conflicts. Here is the scenario:

*Package1* and *Package2* both need *@cool/stuff*. *Package1* therefore defines `"@cool/stuff": "~1.0.0"` in its dependencies. *Package2* though was developed with a specific version of *@cool/stuff* so it defines: `"@cool/stuff": "1.2.3"` which is the newest version currently available. This works fine because `~1.0.0` will be resolved in the newest 1.x version.

But one fine day the developer of *@cool/stuff* adds even more cool stuff and decides that the package earned a new version number 1.3. Yeah! Level up!

Unfortunately we have a problem now: *Package1* asks for `~1.0.0` so it will from now on get the shiny new version `1.3.0`. Yarn and Node are not able to decide that the existing 1.2.3 is sufficient (which it would be) and it installs both versions. This might not be a problem as long as those versions are not interfering but if *@cool/stuff* is incompatible towards each other (in my case it was *prosemirror-model* btw) you get weird issues.

## Solution

To finally conclude this way too long TIL post and to solve that issue you can add an entry to your package.json:

`"resolutions": { "@cool/stuff": "1.2.3" }`

This is understood out of the box by *Yarn* and it is called [selective dependency resolutions](https://classic.yarnpkg.com/en/docs/selective-version-resolutions/). NPM doesn't understand it without the help of the package [npm-force-resolutions](https://www.npmjs.com/package/npm-force-resolutions) as far as my short research showed me.

Thanks for reading and I hope it helps with that one super weird problem <3
Do you know the software to host a webinar?
Tags: question
Published: 2020-03-19 12:12:39

---
title: Do you know the software to host a webinar?
published: true
description: 
tags: question
---

Hi everyone!

Because of COVID-19 my client's trainers are restricted to go to business trips but have to land the same count of workshops annually.

So we decided to use a platform for webinars to do those workshops remotely but we can't find a solution.

We checked out YouTube Live and some SAAS solutions but they don't meet the client's requirements.

What we need:
- Ability to integrate all functionality (video stream, chat room, etc.) to our website;
- Ability to record webinars and host those videos on our website in the archive;
- Ability to style UI of the player and chat (branding);
- The solution can be paid or some OSS projects as well;
- The client doesn't want to show any attribution (I, personally, think that it's okay and even great to show solution attribution).
How to make server access sharing easy and secure ?
Tags: security, server, access
Published: 2020-03-19 11:59:08

Easy! Very easy!

Only 7% of companies can exactly name all people having access to their servers (according to ForcePoint).

Our platform Werbot allows the secure sharing of pseudo-access to servers among employees or freelancers without worrying about server security. It allows safe storage of original access in one place for the purpose of controlling the work performed by employees on servers, auditing their work, and controlling the overall security of the system.

Every server owner using Werbot will know exactly who has access to the server, what each user is doing, and when they are doing it, simply by viewing the screen records. The owner can grant or deny access in a few seconds. The server access password is known only to its owner, while employees can only log in using the access provided by Werbot

Here is how it can be used:
Once you are connected to the SaaS version or installed the Enterprise version, you need to create your first “Company” and to add accesses to all the servers that you will use. Then you can invite “Users” through emails or LDAP. You can define “Users” for each server, they will be the only people who will have access to it. 
It’s very convenient for “Users” because they don’t need anymore to remember multiple passwords and settings for different servers. All connections to servers are made through a single sign on with a private user access.
All the actions performed on servers and in Werbot web interface are logged and recorded. Server administrator can see not only what was done on the server by each “User” and when it was done, but also can replay the whole working session in our player.

Start your 14-day trial today - https://werbot.com
Remote Work - useful resources about WFH
Tags: productivity, remote, wfh, corona
Published: 2020-03-19 11:47:38

---
title: Remote Work - useful resources about WFH
published: true
description: best links that I found about working from home. Could be useful for many WFH devs.
tags: productivity, remote, wfh, corona
---

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9urflsl2w5ix0ry141yp.jpeg)

Hi Devs!

This is my first article here. I've prepared list of reasources that are related to remote work, because many people in my country (Poland) have to work from home because of virus. Take a look, and maybe some links will also be useful for you.


1) List of tools for remote work - every soft you need
https://nohq.co/tools/
INFO: tools for communication, recruitment/employment, task and project management and many, many more.

2) Dozens of interviews with bosses and employees of companies operating in the remote work model
http://pajamas.io
INFO: this page has not been updated for a long time, but it is still full of knowledge for anyone who would like to work from home.

3) The biggest evil in remote work? Adaptation of employees to the boss's work schedule
https://marker.medium.com/the-managers-schedule-is-holding-remote-work-back-f9c1302ac6f3
INFO: remote work should be (as much as possible) asynchronous.

4) Knowledge hub about remote work - a huge collection of articles and materials
https://www.notion.so/Remote-work-wiki-1b21ef5501714fffa9f5c5c25677371f
INFO: daily updated collection of links about remote work.

5) Episode of the 'Yonder' podcast about remote work - the company have 15+ years experience (1 hour audio)
https://www.yonder.io/post/2020/3/14/ep-84-remote-work-during-a-pandemic
INFO: below the recording, there is a complete transcript for people who prefer reading rather than listening or for people with a severe auditory impairment

6) Remote work - pros, cons and how to deal with it. Thoughts from famous blogger after 4 years of remote work
https://jvns.ca/blog/2018/02/18/working-remotely--4-years-in/
INFO: few thoughts about dealing with working constantly from home office and how to not lost relationships in real world

7) Free guide about remote work from Zapier (a company with employees in several countries around the world)
https://zapier.com/learn/remote-work/
INFO: how to work in different time zones? How to avoid burnout when working remotely? How to work faster and more productive?

8) How we work remotely in GitLab
https://about.gitlab.com/company/culture/all-remote/guide/
INFO: follow links in every chapter to read more about each topic

9) "40 lessons learned from 4 years of remote work" - from Buffer company
https://stories.buffer.com/remote-work-lessons-f07d67f06b1e

10) List of places where you can find remote job for freelancers (97 services)
https://docs.google.com/spreadsheets/d/1JfNAbUX_lN9K3MCNHO15GJtJ5qpk7H9Cl3xTBwv2FR8/edit#gid=366809548

--
This list was oryginaly created in Polish language only.
English translation prepared by Wojciech Błaszczuk (Twitter: julianvolodia )
Git basics in a FLASH!
Tags: versioncontrol, gitbasics, programming, git
Published: 2020-04-13 01:29:07

---
title: Git basics in a FLASH!
published: true
date: 2020-03-19 10:59:54 UTC
tags: version-control,git-basics,programming,git
canonical_url: https://medium.com/fuzzy-code/git-basics-in-a-flash-8938417608f0
---

![](https://cdn-images-1.medium.com/max/1024/0*aijSXzTiiKWG7Ymc)<figcaption>Photo by <a href="https://unsplash.com/@yancymin?utm_source=medium&amp;utm_medium=referral">Yancy Min</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption>

Hello World! Apart from adding, committing and pushing files to the repository, here are some common git operations, in a flash!

### 1. Branching

Branching is necessary when you want to work on a new feature (or for other reasons) and separate your code from master branch.

**Create a branch and checkout:**

```
git checkout -b nameOfYourNewBranch
```

**Delete a local branch :**

```
git branch -d branchName
```

**Delete a remote branch:**

```
git push origin -d branchName
```

### 2. Merging

Merging a branch is necessary because you might want to merge a feature branch to the master branch.

```
# Start a new feature

git checkout -b new-feature master

# Edit some files

git add <file>

git commit -m “Start a feature”

# Edit some files

git add <file>

git commit -m “Finish a feature”

# Merge in the new-feature branch

git checkout master

git merge new-feature

# Delete the new-feature branch

git branch -d new-feature
```

### 3. Stashing

Stashing is used when you temporarily want to put away your change and have the clean woking tree. Don’t worry, you will be able to get your stashed changes back.

**Stashing current work:**

```
git stash
```

**Listing stashes**

```
git stash list
```

**Importing latest stash:**

```
git stash pop
```

**Importing particular stash if more than one:**

```
git stash pop stash@{n}
```

**Dropping stash:**

```
git stash drop stash@{n}
```

Here, n refers to a number, 0, 1, 2… which represents which stash to delete.

### 4. Cleaning Cache

Cleaning cache is required when you want to remove previously added files which you don’t want to track anymore.

**Clean all git cache:**

```
git rm -r --cached .
```

**Clean cache of only required file:**

```
git rm fileName --cached
```

* * *
Testando lançamento de exceções com Jest
Tags: jest, testing, javascript
Published: 2020-03-19 11:43:22

Testar se uma função trata corretamente erros é algo comum em testes unitários. Quando esse tratamento ocorre por meio de exceções, é fácil se perder frente à quantidade de possibilidades - além do fato de não ser tão trivial quanto parece.

Antes de mais nada, neste tutorial eu assumo que:
- Você está familiarizado com `async/await`;
- Você já utilizou o jest e sabe o contexto de termos como `describe` e `it`;
- Você sabe lidar com exceções.

## O problema
Imagine as seguintes funções:
```javascript
// funcs.js
const foo = () => {
  throw new Error('Something wrong');
}

const goo = async () => {
  throw new Error('Something wrong - async'); 
}

const boo = (n) => {
  if (n < 0) {
    throw new Error('Something wrong - params');
  }
}

const doo = async (n) => {
  if (n < 0) {
    throw new Error('Something wrong - async + params');
  }
}

export default { foo, goo, boo, doo };
```
Como seria possível testar se a exceção é lançada corretamente? Você pode pensar em algo assim para a função `foo`, por exemplo:
```javascript
// funcs.test.js
import { foo } from './funcs.js'

test('Should throw exception', () => {
  try {
    foo();
  } catch (e) {
    expect(e.message).toBe('Something wrong');
  }
});

```
Contudo esse teste não seria muito eficiente, uma vez que ele poderia passar quando nenhuma exceção está sendo lançada. Além disso, o Jest nos possibilita fazer algo muito mais simples, sem a necessidade de escrever uma estrutura tão grande.

## Funções Síncronas sem parâmetros (foo)
Esse é o caso mais simples. Basta passar a função como parâmetro para o `expect` e utilizar o método `toThrow` (ou similares). Nesse caso, teríamos algo assim:
```javascript
import { foo } from './funcs.js'

test('Should throw exception', () => {
  expect(foo).toThrow();
});
```
> Caso queira verificar o tipo de erro, você pode utilizar o `toThrowError`:
> ```javascript
> expect(foo).toThrowError(new Error('Something wrong'));
> ```

## Funções Síncronas com parâmetros (boo)
Aqui temos uma pequena diferença. Vamos chamar a função com um dado que deve gerar exceções dentro de uma função anônima e passar esta para o `expect`:
```javascript
import { boo } from './funcs.js'

test('When n < 0, expect to throw Error ', () => {
  expect(() => boo(-1)).toThrow();
});
``` 

## Funções assíncronas (goo, doo)
Aqui teremos duas mudanças. A primeira é que a função passada para o `test`/`it` deve ser assíncrona. A outra é que vamos chamar a função diretamente dentro do `expect` e testar se a Promise será rejeitada e retornará um erro:
```javascript
import { goo, doo } from './funcs.js'

test('Expect to throw Error ', async () => {
  await expect(goo()).rejects.toThrow();
});

test('When n < 0, expect to throw Error ', async () => {
  await expect(doo(-1)).rejects.toThrow();
});
```
-----
Nas funções assíncronas podemos realizar chamadas diretamente pelo fato delas não lançarem a exceção diretamente, mas retornarem Promises rejeitadas. Caso o mesmo seja feito para funções síncronas, o teste será interrompido e não funcionará corretamente.
Handling JWT securely on your client
Tags: security, jwt, beginners, tutorial
Published: 2020-03-19 11:33:24


This is a series of posts divided into the following parts:
- [Handling JWT securely on your client - Part-1](https://mannharleen.github.io/2020-03-19-handling-jwt-securely-part-1)
- Handling JWT securely on your client - Part-2
- Handling JWT securely on your client - Part-3
- Handling JWT securely on your client - Part-4

### Summary
* Part-1 covers the main problem statement around jwt security in web-apps; presents a few options and evaluates them 
* Part-2 dives deep into overcoming limitations around the chosen option in Part-1 e.g. SSO, Silent Authentication/Refresh, etc.
* Part-3 talks about non web-apps i.e. backend rest clients that don't run on web browsers e.g. postman
* Part-4 talks about other values added flows such as jwt expiry, force logout etc.


# Handling JWT securely on your client - Part-1

#### Assumptions
- We will focus on Single Page Application (SPA) web-apps here
- jwt here are treated as access tokens or sessions tokens
- Our Use case:
    - Our website is a SPA and hosted on app1.com
    - The SPA allows login and logout at /login and /logout
    - After logging in the SPA displays a button called "getData"
    - Once the button is pressed, the client-side-js sends a request to /api/data to obtain some data

[......continue here](https://mannharleen.github.io/2020-03-19-handling-jwt-securely-part-1/)
Coronavirus COVID-19 outbreak dashboard

Tags: coronavirus, react, kubernetes, covid19
Published: 2020-03-19 11:26:06

TLDR, I've built a Coronavirus COVID-19 dashboard [here](https://www.cov19.xyz/)

COVID-19 outbreak is not a hoax anymore
---
I've seen people around calling it "just-another-flu". And to be honest, I was thinking the same, until 3 weeks ago, when Italy started to see growing COVID-19 clusters. And 2 weeks ago, Italy went full nation lockdown. Our life changed completely.

Lacking information
---
We've seen what happened in Wuhan, China, in Korea. But we never thought it would happen here.
We didn't know what to protect ourselves.
We lost in fake news, in fake articles (I saw some articles on Facebook, saying hand dryers can kill the viruses!)

That's why I've decided to build a [COVID-19 dashboard ](https://www.cov19.xyz/)
---
I want to update the current situation to everyone, in every country. So people can see what's happening with other countries, and understand that it will happen in their country as well.

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

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

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

I want to put trusted information from WHO and universities, experts. To help people protect themselves and their family.

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

Don't forget, our country is fully locked down, in just 3 weeks. 
Thanks
City Builder in Unity3D | Part 2
Tags: youtube, game, city, builder
Published: 2020-03-19 11:20:31

Hey!
This is my 2nd part in my series, 
in this series I'm writing a City Builder Game,
Come, Watch and leave a Like and Subscribe :)

{% youtube U-h1yyVwBpg %}

> Like this post? 
> Support me via [Patreon](https://www.patreon.com/eranelbaz)
> Subscribe to my [YouTube Channel](https://www.youtube.com/channel/UCVUNeBGM5wZJKcOx0QwAaTA)
Modern C++ : constexpr
Tags: cpp, beginners, tutorial
Published: 2020-03-19 11:11:39

Following my series from less known features of Modern C++.

{% post https://dev.to/delta456/modern-c-an-introduction-36kg %}

`constexpr` means constant at compile time. It was introduced in C++ 11 and later improved in C++14. It is generally used to save time and get the value at compile time. 

## Syntax

```cpp
// Declaring variables
constexpr type name = value;

// Declaring functions
constexpr type func_name(...) {
  // body
}

// Declaring classes and methods
class Foo {
   int foo;
 public:
    constexpr Foo(int i) : foo(i){}
    constexpr int GetSize() { return foo; }
}
```

## Difference between `const` and `constexpr`?

- `const` can be used for `runtime` and `compile time` but `constexpr` can only be used for compile time values.
- `const` is just a constant whereas `constexpr` is a **constant expression**.
- `const` can only be used for non-static function members but not for functions but `constexpr` can used anywhere but the return type should be a literal.
- All `constexpr` values are `const` but not vice versa.

## When to use `constexpr`?

- Size for arrays
- Optimization
- Constant Expression

## Rules

 1. Variables

 - It must be Literal Type
 - Initialized at compile time

 2. Functions

 - Return type must be Literal
 - Parameters must be Literal
 - Must not contain `goto`
 - No Definition of non literal type


If you find some faults or some more content to add then please don't forget to comment.