teleren/devto huggingface dataset:
Mutual Code Review
Published: 2020-03-24 11:12:08

Hey I’m transitioning to being an open source developer full time. The downside is I don’t have anyone to review my PRs yet or bounce ideas off of. 

Would any Node developer be interested in exchanging code review time with me?

I’m working on some cool CLI utilities now
https://github.com/tolicodes/node-cli-toolkit
Also a cool queue utility. WIP. Gotta document it and test it (I wrote before I was into TDD) but the code is pretty sound
https://github.com/tolicodes/node-api-toolkit/blob/master/packages/queue/index.ts
Generate any Oauth token via CLI
Tags: node
Published: 2020-03-24 11:04:30

Hey guys,
First post. I’ve been writing a few CLI utilities. My latest one generates an oauth token using the CLI. You just pass it a passport strategy (there’s one for just about any provider), pop in your key and secret, run the command and out comes a token!

https://github.com/tolicodes/node-cli-toolkit/tree/master/packages/generate-oauth-token-cli

I’d love to get feedback!
Persist data offline in React Native through with AsyncStorage 
Tags: reactnative, react, javascript, tutorial
Published: 2020-03-24 10:18:02

It's important to make sure you store data in your mobile application so that if the users' logins in, the details or token remain, ensuring that the user doesn't have to login again.
{% youtube PRGHWgTydyQ %}
Normally on the web, this is done in a number of ways, such as saving it in local storage, however, for mobile applications like on react native, this is done by using async storage.

This guide will include:
* What is asyncstorage
* Installing and setting up async storage in react native
* Setting and getting values that persist restarts of the app
* Multiple value storage and retrieval 
* Storing JSON objects in async-storage
* Retrieving objects by parsing stringified JSON's

Hopefully, this guide gives you a good idea how to start using react native async storage, as it's something I personally use in almost every single app I make.

## Follow and support me: 
Special thanks if you subscribe to my channel :)
* [🎞️ Youtube](https://www.youtube.com/channel/UCvM5YYWwfLwpcQgbRr68JLQ?sub_confirmation=1)
* [🐦 Twitter](https://twitter.com/adrian_twarog)
* [💬 Discord](https://discord.gg/nGdThpE)
* [💸 Patreon](https://www.patreon.com/adriantwarog)

## Want to see more:
I will try to post new great content every day. Here are the latest items:
* [Adobe XD to Fully Responsive WordPress Site](https://dev.to/adriantwarog/adobe-xd-to-fully-responsive-wordpress-site-16e0)
* [Adobe XD to HTML Full Process](https://dev.to/adriantwarog/adobe-xd-to-html-full-process-ao6)
* [Full Tutorial on how to use SASS to improve your CSS](https://dev.to/adriantwarog/full-tutorial-on-how-to-use-sass-to-improve-your-css-57on)
* [Creating a Mobile Design and Developing it](https://dev.to/adriantwarog/creating-a-mobile-design-and-developing-it-5c4o)
Clean Object by Values
Tags: javascript, snippets
Published: 2020-03-24 10:16:50


Function to remove specific values from an object (_including nested values_), **by default only null values are removed**, but an array of values to remove can be passed as second argument:
```js
function cleanObject(obj, valueToClean = [null]) {
    if (!isObject(obj)) { // isObject defined below
        throw new Error('"obj" argument must be of type "object"');
    }

    const cleanObj = {};
    let filter = valueToClean;

    for (let key in obj) {
        const objValue = obj[key];

        if (Array.isArray(valueToClean)) {
            filter = val => valueToClean.includes(val);
        } else if (typeof valueToClean !== 'function') {
            filter = val => val === valueToClean;
        }

        if (isObject(objValue)) {
            cleanObj[key] = cleanObject(objValue, filter);
        } else if (!filter(objValue)) {
            cleanObj[key] = objValue;
        }
    }
    return cleanObj;
}
```

`isObject` function from: [Is value an object
](https://dev.to/nombrekeff/is-value-an-object-2hbc)
```js
function isObject(val){
  return (
    val != null && 
    typeof val === 'object' && 
    Array.isArray(val) === false
  );
}
```

Usage:
```js
const clean = cleanObject({ name: 'Manolo', email: null, tags: null });
// > { name: 'Manolo' }

const clean = cleanObject({ name: 'Manolo', email: null, tags: [] }, [null, []]);
// > { name: 'Manolo' }
```
Day 11 [D&D Character Sheets
Tags: 100daysofcode
Published: 2020-03-24 06:57:35

# Report
Not much to report today, I started working on authentication with passport but didn't finish today.

# Project

{% github ApproachingApathy/100days-dnd-character-sheets %}

The First project will be an app to keep D&D character sheets.

## Stack

I'll be using Node.js and building a full-stack Express app with MongoDB.
### Requirements
#### Minimum Viable 

- [ ] Investigate automating or finding a source of info for the data in the SRD.
- [ ] Present a D&D Character Sheet
    - [ ] The sheet should display all the same info as the first page of the 5e Official sheet.
- [ ] Users should be able to log in and create player-characters.
- [ ] Users should be able to edit character sheets.
- [ ] Users should be able to organize character sheets into groups (parties/tables)
- [ ] Sheets should auto calculate basic stats like ability modifiers.
    - [ ] Support Proficiency Bonuses 

### Cake
- [ ] Extend character creation to allow the user to use any of the three common stat gen methods.
    - [ ] Point Buy
    - [ ] Standard Array
    - [ ] Roll
- [ ] Extend the character sheet to all the info in the 5e official sheet.
- [ ] Allow for image uploads for character portraits.
- [ ] Allow for extended descriptions/backstories.
    - [ ] Characters should have nice full page backstories.
    - [ ] Preferably use a markdown editor.
Download Any File from Blob
Tags: javascript, snippets
Published: 2020-03-24 09:54:40


I'm posting this here to have it accessible and maybe somebody will find it useful as well!


> ## Deprecated (see next snippet)
```js
function downloadBlob(blob, name = 'file.txt') {
    if (
      window.navigator && 
      window.navigator.msSaveOrOpenBlob
    ) return window.navigator.msSaveOrOpenBlob(blob);

    // For other browsers:
    // Create a link pointing to the ObjectURL containing the blob.
    const data = window.URL.createObjectURL(blob);

    const link = document.createElement('a');
    link.href = data;
    link.download = name;

    // this is necessary as link.click() does not work on the latest firefox
    link.dispatchEvent(
      new MouseEvent('click', { 
        bubbles: true, 
        cancelable: true, 
        view: window 
      })
    );

    setTimeout(() => {
      // For Firefox it is necessary to delay revoking the ObjectURL
      window.URL.revokeObjectURL(data);
      link.remove();
    }, 100);
}

// Usage
downloadBlob(blob, 'myfile.pdf');
```
> **NOTICE**
> As Kaltu pointed out in the comments: **it seems "window.URL.createObjectURL()" had been blocked by all major browsers since 2019 for security reasons.**



This approach should work as expected:
```js
function downloadBlob(blob, name = 'file.txt') {
  // Convert your blob into a Blob URL (a special url that points to an object in the browser's memory)
  const blobUrl = URL.createObjectURL(blob);

  // Create a link element
  const link = document.createElement("a");

  // Set link's href to point to the Blob URL
  link.href = blobUrl;
  link.download = name;

  // Append link to the body
  document.body.appendChild(link);

  // Dispatch click event on the link
  // This is necessary as link.click() does not work on the latest firefox
  link.dispatchEvent(
    new MouseEvent('click', { 
      bubbles: true, 
      cancelable: true, 
      view: window 
    })
  );

  // Remove link from body
  document.body.removeChild(link);
}

// Usage
let jsonBlob = new Blob(['{"name": "test"}'])
downloadBlob(jsonBlob, 'myfile.json');

```
> Demo can be found [here](https://codepen.io/keff/pen/ExPVjWz)
Massive Resources For Every PHP Developer To Bookmark  
Tags: php, webdev, codenewbie, beginners
Published: 2020-03-24 09:10:44

If you are a php dev then keep reading till the end of the post. I got a lot of good stuff for you. And if you hate php, it is not going to hurt you to keep reading. Consider reading for a future reference. 

**I have written short descriptions on every section to not bore you out. All i want is you getting to the end of the post to get the whole resources**

**And to the point :)**


#1-KillerPHP

LINK: [killerphp.com](killerphp.com)
One of the most insightful websites when it comes to php and web development in general. It contains blogs, videos, short tutorials... etc. It has been around since 2010 now, So give it a try.



#2-NomadPHP

LINK: [nomadphp.com](nomadphp.com)
Every php developer's recourse when it comes to conferences, workshops, and talks. It has hundreds of written tutorials about php development, best practices and so on.



#3-PHPtpoint

LINK: [phptpoint.com](phptpoint.com)
An unrated huge source of knowledge about php, oop, and advanced php stuff.


#4-dna88.com

LINK: [dna88.com](http://www.dna88.com/ultimate-list-of-php-web-development-tools-resources/)
The domain sounds weird, I know, but the website is unbelievable. It contains everything you need. **I mean literally EVERYTHING** (Frameworks, Routers, HTTP, Template, Imagery, Testing, Docs, Security, Recommendations for books) and the list goes on and on.


     
#5-PHP the right way

LINK: [phptherightway.com](phptherightway.com)
It is the best documentation out there, maybe better than the official. All the stuff you need to start with is there.


#6-PHPpot

LINK: [phppot.com](phppot.com)
It is really great for beginners. It helps them to create projects to train themselves with real-world source codes. It contains a ton of projects and most importantly, it is free of charge.


#7-PHPclasses

LINK: [phpclasses.org](phpclasses.org)
There is no php dev that does not know about this website. It is big on scripts, written tutorials, jobs, even book reviews.   

   

#8-phparch

LINK: [phparch.com](phparch.com)
A whole magazine for php devs. Also great for book reviews, talks, and tutorials.


 
#9-PHPflow

LINK: [phpflow.com](phpflow.com)
One of my favorite recourses. More and more blogs, tutorials and source codes. It is also great for MySQL, jquery and angular.

 
#10-phpclicks

LINK: [phpclicks.com](phpclicks.com)
It has a variety of advanced yet interactive content about php, mysql, jquery, and wordpress.


#11-packagist.org

LINK: [packagist.org](packagist.org)
Every php developer's recourse of packages. It contains everything you need to know about opensource composer packages. The website is integrated well to github to ease the process of creating and publishing new packages.


   

#Conclusion

These just are my personal favorite resources. Have anything to share with me? Feel free to comment down below. **Thanks for reading :)**
TetraQuicky05: The right way of copying recursively a directory - the right flags of rsync
Tags: linux, wsl, rsync, bash
Published: 2020-03-24 09:06:34

# TL;DR
```bash
rsync -avru --info=progress2 <Source_Dir>/ <Destination_Dir>/
```
# More on that
I use the above so much that I still don't understand why I didn't set it as alias.

The advantage over the normal `cp -rvf` is that `rsync` copies incrementally and it is able *to continue if it is interrupted*.
It works great also for copying over the network with samba and stuff like that (I use it most of the time over samba drive mounted with `cifs` and I never had a problem)

There are a gazillion of frags (have fun with `man rsync`). 
Specifically I am always after:
- `-a` a cumulative flags that enforce to preserver during the copy also symlinks, permission timestamps and all the things of the files
- `-v` just to print what are you copying
- `-r` recursively
- `-u` important one; *update* that means that if the is a difference between a file in source and destination the source will be always updates (usefull when a previous run, left some file incomplete and you want to make sure the correct version from the source is overwritten) but if the files are the same, just skip it - that actual make rsync the best incremental tool
- `--info=progress2` is "tries" to give you a progress status percentage of the files while you are copying (where there is a lot of stuff it might be wrong on the road, but hey... better than nothing right?)

you will not use `cp -rvf` any more after this post (also because rsync is basically included in every distro on planet).

---
*NOTE:*
A remember to put the slash at the end of the directories you want to copy if you don't want `rsync` to put a new directory under you destination directory. Otherwise if you don't do this...
```bash
rsync -avru from/   to/
```
you will end up with:
```bash
to/from/
```
in the destination.

---

# ...and for Powershell?
I've read about `robocopy` but it seems something bizantine at first touch. Personally in windows I still use`rsync` via `WSL`. I used to use it also via `cygwin` although it was really slow (and the cygwin version was super out-of-date there there was not `--info=progress2` flags)

# Bonus
You need to sync and mirror 2 directories (like... also deleted files from source to be deleted in destination)? Have a look at `--delete` flags. Slow copy over the network? Give a try with `-z` (although sometime compressing big file might waste more of your time if you computer is not like super powerful).
made a package manager in python3
Tags: python, linux, glitch
Published: 2020-03-24 08:32:33

https://support.glitch.com/t/workman-package-manager-wip-for-python3

so i made a package manager in python. works fine and it allows installing of packages from our library as ZIP files- which get decompressed client-side.

i would make a better intro but i suppose you might as well try for yourself.

<code>wget https://workman-pack.glitch.me/workman.py</code>

packages available:

-XenText 2.0 / CLI
package name: xent

------

check the topic link at the top for better information!
- 17lwinn
With so much doom and gloom about at the moment lets all share something positive.
Tags: share, community, discuss, watercooler
Published: 2020-03-24 08:26:09

---
title: With so much doom and gloom about at the moment lets all share something positive.
published: true
description: Unless you have been living under a hill for the last couple of months; you may have heard lots of doom and gloom stories. Let's share some positive and good news with each other.
tags: Share, community, discuss, watercooler
---

Unless you have been living under a hill for the last couple of months; you may have heard lots of doom and gloom stories. Let us share some positive and good news with each other.


This may or may not be tech-related. Let's be positive.

Stay safe.
🎥 Video Snippets: [4 => Bootstrap] 🥾
Tags: beginners, codenewbie, css, html
Published: 2020-03-24 08:03:43

Containers are the most basic layout component in Bootstrap 4. They wrap content, providing basic padding and margin to go around content. They also help to centre content. 

There are two types of containers- fluid and fixed. A fixed container always has a maximum width and is centred on the page. The maximum width changes depending on the breakpoint of the viewport. A fluid container is always 100% of the viewport width or its surrounding container if it has a max-width property on it. 

<kbd>Source: <a href="https://www.youtube.com/watch?v=E7R23erzuGg&list=PL4cUxeGkcC9jE_cGvLLC60C_PeF_24pvv&index=4"> Bootstrap 4 Tutorial #4 - Containers</a></kbd>
Trick to rebuild summary tables when the existing data have to remain available during the operation
Tags: sql
Published: 2020-03-24 07:47:49

As a Data Engineer, I encountered situations where the summary or reporting tables need to be repopulated daily. When the population is ongoing, we need to make sure that the existing data is still available to the user. 

We can achieve this by using a “shadow table” which acts like a staging table you build “behind” the real table. When you’re done building it, you can swap the tables with an __atomic__ rename. For example, if you need to rebuild my_table, you can create my_table_new, fill it with data, and rename it as my_table. In case the new table has a problem, you can rename my_table to my_table_old before that for a quick rollback. 

```
mysql> DROP TABLE IF EXISTS my_table_new, my_table_old;
mysql> CREATE TABLE my_table_new LIKE my_table;
-- populate my_table_new as desired
mysql> RENAME TABLE my_table TO my_table_old, my_table_new TO my_table;
```
Quarantined, 154 Days Of Code
Tags: 100daysofcode, ruby, codenewbie, rails
Published: 2020-03-24 07:30:50

As you might know if you read my last post, I was laid off from my job. I've done all the filing for assistance that I can do while applying for new jobs. I took a "Career Readiness Certificate" test that some jobs around the united states require (I passed with a platinum rating - probably a little brag there) and have applied for some local jobs that required it.

The next thing on my long todo list was getting my portfolio site done. It is as complete as I can make it without adding a ton of fluff. Its built with Jekyll/Ruby/HTML/CSS and doesn't have a lot of flash, but it does have a blog which took some days to iron out an issue I had with using images as buttons. A friend on twitter helped out with it. Apparently you can't just link a document to an image with straight HTML of using Jekyll, you have to use their code. I'm thinking of doing a writeup/tutorial on the whole process if anyone is interested. 

My next goal is to finish some projects. I have a half finished todo list done in JavaScript I may complete just to put something up, and an actual blog site app I'm building in Ruby on Rails for this course I've been doing. The rails project gets first priority since it's big and I really want to learn rails well. 

Awhile back I was doing Free Code Camp's curriculum. I completed all the exercises for the Responsive Web Design Certification, so today I built one site and half of the portfolio site needed for that. I initially tried to use the site I already had built, but their code checks didn't work too well with Jekyll. I managed to get 6/12 checks to pass but couldn't get any more, and I'm not a cheater so I have to build all the projects or it's pointless.

All in all I'm feel like I'm making big progress. I'm really looking forward to finishing this 100 days and starting the next!

Shameless plug:
Oh, and if anyone is reading this and is hiring Jr Developers or is willing to bring someone on board to learn a stack let me know. I don't have a bunch of projects completed yet, but I have hella work ethic and I can learn fast. :)
It is better to write something complicated that people find it hard to understand
Published: 2020-03-24 07:28:40

I found that if I don't understand something that well, I can write some blog post, and people find it hard to understand, and they say, "this guy is good. He knows many complicated concepts."

But if I invest extra time to understand it really well, and write it and explain it even a 15 year old can understand, then some people come and read it, and conclude "it is so simple. This guy is just basic. There is nothing really that great." And they lose respect for you.

But I think it is just one of the IIJTWII: It is just the way it is.

Let me add the background to this story:  I was interviewing with a company, and the VP Engineering wanted to hire me even as a director of front end.  And we were talking, and the VP had me talk to the CEO and COO.  Along this time, I was writing something, and I can make it complicated, but I made it so simple that even a 15 year old can understand it. Possibly the CEO and the COO searched on the Internet and saw those newest posts, they actually later on retracted and wanted to only hire me as a consultant or contractor to try for 3 months first, instead of being the director of front end.  These events all happened about the same time, so I think it could be due to the CEO and COO seeing something so simple, they lost the respect for it.  It may be like, when people cannot understand relativity or quantum mechanics, they have a lot of respect for it, but let's say somebody is so good in them and can explain them so that they can be understood as easily as Newtonian physics, then people would lose respect for it.
I noticed being a contractor earn 40% to 50% less, and no 401K, no ESPP, no insurances, no vacations
Tags: salary, contractor, discuss
Published: 2020-03-24 06:55:59

So who wants to be a contractor really?

I noticed there are some cases but beyond that I don't understand:

1. Programmers who hop from job to job for 4 months and sometimes 6 or 8 months... but by the time they are familiar with the system, they move on. (and why does the company not want to keep them longer?)

2. Apple hires many contractor programmers, maybe perhaps programmers don't mind getting paid less but having the Apple name on their resume? But after 1 year of being paid 50% less, do you still want to work there? It can be like taking away $50,000 or $60,000 away from you.

I noticed I should not say "no vacation, holidays, sick days, bonuses, stock bonus"... that's because all those already got factored into the salary difference already. Actually, I guess holidays do... because contractor and Full Time Employee both take them, with the final salaries being compared. But vacation and sick days... if contractor decide to take 3 weeks off, then no pay -- meaning a pay cut. But if Full Time Employee take them, it is included as part of their package every year and there is no pay cut.

So the final version should be: 50% less pay, and also no 401K, no ESPP, no insurances (health, life, vision, dental), no vacation, no sick days. (about 3 weeks or 120 hours each year).
Angular Developer Survey 2020
Tags: angular, survery
Published: 2020-03-24 06:50:13

---
title: Angular Developer Survey 2020
published: true
description: 2020 Angular Developer Survey 
tags: angular, survery
---
2020 Angular Developer Survey is up!
If that "92% chunk asset optimization" gets your goat, now is the time to share your frustration:

https://google.qualtrics.com/jfe/form/SV_5cZx8CJ2B5kkpKt
Articles that made my Week #007 - Sorta
Tags: career, watercooler
Published: 2020-03-24 06:41:29

Hey! So I'm trying to setup my week so I can publish this 3 days earlier. I'm trying to get back to doing this Friday nights. 

Before I continue. This is last weeks article. 

{% link https://dev.to/malgamves/articles-that-made-my-week-005-006-2ih %}

Sort of looking back to why I started doing this. I wanted to be consistent and intentional with what I'm consuming and doing this every week was my way of remaining aligned with my goals both professionally and personally. I love doing it, I go back and read the ones I've done before this. Lately though life has just been harder than usual and even though routine in a time like this has been advised. It is insanely hard to follow at the moment. I won't lie... I didn't read much this week. I've been battling with very unexpected rejections, having to self isolate. It's a hard time for everyone, sending out good vibes! 

Back to this, I use this as a diary. I gauge past week, like Dev as a Diary (DaaD) and I guess this is just a reflection of where I'm at. I want to use this as a reset for the week. Rekindling the flame! I'll share articles I've written recently and hopefully they can make your week.

{% link https://dev.to/malgamves/vuex-why-we-need-spa-state-management-42cj %}

{% link https://dev.to/malgamves/dynamic-styling-in-vue-js-inline-css-3me1 %}

{% link https://dev.to/malgamves/event-triggered-graphql-1p6n %}

{% link https://dev.to/malgamves/building-a-realtime-collaborative-microsoft-paint-1h7f %}

Just some of my writing over the last month. 

If they do make your week. Let me know - it'll make my week. Have great one!