teleren/devto huggingface dataset:
FlytLabs custom web development team
Published: 2020-07-22 01:13:13

Hello,

I'm the founder of 'FlytLabs' (https://flytlabs.dev). We're working on a few projects, but that's not why I'm here. I'm looking for developers who would like to gain real experience working on websites for businesses, groups and people alike. The advantage is the potential stability of our work, as we can leverage our experience, examples, group and public face in general to bring them in in the first place, something that not all developers who have time and interest may be able to do (especially if you haven't done much client related!). We already have two businesses which we're talking with in regards to doing this, after asking around for only a couple days.

### Payments:

There will be small down payments, around or under $200, to begin a project (maybe none, depending on complexity. Our current two projects in line are looking detailed however). 

After this, we're organizing with the clients to collect a 15 - 25% take in the websites gross sales for the first 3 months. Keep in mind, we're upgrading sites that already make sales as well. This gives us time to tweak if it's not performing as well, and adjust the deal if needed. Overall, if allows us plenty of time to fix anything, despite the fact we'll be in constant coordination with the client - thus it will be largely in their reins. This percentage is calculated from their already made sales, and actual margins. As long as we take it on us and understand if our sites always look stellar, we'll only be taking deals which we assume we'll get a good return on for our time, due to past performance.

We will split 85% of this total amount between the developers evenly. The rest will go towards the group to finance its other projects and expenses.


There will be no commitments to joining. If you contribute fairly to even one project, you will receive an even cut to everybody else (we'll do our best to divide work up as such). If you tag along for a while or only end up helping out with just one project, we're just looking for anybody and everybody interested regardless. We hope that not only does it provide a solid financial opportunity due to upgrading sites that already make sales, but it also offers members good experience and resume - ready projects to carry under their belt. Between taking good jobs and providing smart deals, we aim to make it nothing but worth it for developers with some time and interest in finding new projects. There's no way you could lose if you can afford these two things.

So, if you're into anything web - based, whether it's back or front end, shoot me a message or email ben@flytlabs.dev for more information or inquiries.

Thank you for your time and interest!
The URL Object
Tags: javascript, codenewbie
Published: 2020-07-21 18:22:19

<p>Here's a great trick to get URL properties from a string that I recently discovered thanks to dev.to user <a href="https://dev.to/dailydevtips1" target="_blank">Chris Bongers (Daily Dev Tips)</a></p><p>This method involves using the <code>URL()</code> constructor, available in all modern browsers.</p> 

```js
const url = new URL('http://www.example.com/snippet?utm_campaign=12345#documentation');
```

<p>With the URL object, you can easily access URL properties as such:</p>

```js
{
  hash: "#documentation",
  host: "www.example.com",
  hostname: "www.example.com",
  href: "http://www.example.com/snippet?utm_campaign=12345",
  origin: "http://www.example.com",
  password: "",
  pathname: "/snippet",
  port: "",
  protocol: "http:",
  search: "?utm_campaign=12345",
  searchParams: URLSearchParams {},
  username: ""
}

console.log(url.pathname); // Logs "/snippet"
console.log(url.hostname); // Logs "www.example.com" 
```

<p>Note that one of the properties is the <code>searchParams</code> object, which provides an interface to manipulate the URL's query string (we'll look at it in-depth in another article).</p>

```js
console.log(url.searchParams.get('utm_campaign')); // Logs "12345"
```

<p>
Before this awesome constructor came along, it was common to achieve the same result by creating an anchor tag in order to use the DOM's built-in methods to retrieve the URL info:
</p>

```js
const a = document.createElement('a');
a.href = 'http://www.example.com/snippet?utm_campaign=12345#documentation';
    
a.pathname // "/snippet"
a.hostname // "www.example.com" 
a.search // "?utm_campaign=12345"
```

<p>
While this worked, it felt cumbersome to have to create a document element solely to retrive URL data and could potentially confuse readers of your code of what your intent was. Plus, this would only work with the Web API and not in other environments like Node where <code>URL()</code> would clearly be the superior method. 👑
</p>

<h3>Links</h3>
<a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL" target="_blank">MDN Article on URL() Interface</a>

----------
Check out more #JSBits at my blog, [jsbits-yo.com](http://jsbits-yo.com/). Or follow me on [Twitter](https://twitter.com/JS_Bits_Bill)!
NASA Mission Control Deno Project
Tags: deno, javascript, beginners, node
Published: 2020-07-22 00:10:15

---
title: NASA Mission Control Deno Project
published: true
description: Built the NASA Mission Control Deno Project
tags: deno, js, beginners, nodejs
---
If you are learning Deno. Somi Jaiswal has built the NASA mission control project using Denojs. It's really interesting to see people are growing so fast in the Deno world.

https://www.linkedin.com/posts/somi-jaiswal-1931174a_deno-deno-learning-activity-6691392113403400192-3B_n

Below is the demo of the app
{% youtube 98VAt7ENdgA%}
How to do arithmetic calculations with objects in JavaScript?
Tags: javascript
Published: 2020-07-22 00:00:00

---
  title: How to do arithmetic calculations with objects in JavaScript?
  published: true
  tags: JavaScript
  date: Wed Jul 22 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/arithmetic-calculations-on-objects
  cover_image: https://melvingeorge.me/_next/static/images/main-24375985125da4339ffdfda2094eeb2e.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/arithmetic-calculations-on-objects)
  
To do arithmetic calculations such as addition, subtraction, multiplication, division, etc you need to overwrite the default `valueOf()` method in the object.

Consider 2 objects `John` and `Lily` with `name` and `salary` properties defined in it.

```javascript
// 2 objects
const John = {
  name: "John Doe",
  salary: 23000,
};
const Lily = {
  name: "Lily Rose",
  salary: 45000,
};
```

What would you think if we try to add these 2 objects together?
Let's find out.

```javascript
// 2 objects
const John = {
  name: "John Doe",
  salary: 23000,
};
const Lily = {
  name: "Lily Rose",
  salary: 45000,
};

// add 2 objects together
console.log(John + Lily); // ==> [object Object][object Object] 😟
```

Well, we would get something like this, `[object Object][object Object]`.
Not useful at all.

We can make this useful by overwriting the default `valueOf()` method in `John` and `Lily` objects, because when doing an arithmetic calculation (+, -, \*, /) with objects JavaScript internally calls `valueOf()` method.

So let's define the method in both the objects.

```javascript
// 2 objects
const John = {
  name: "John Doe",
  salary: 23000,
  valueOf: function () {
    return this.salary;
  },
};
const Lily = {
  name: "Lily Rose",
  salary: 45000,
  valueOf: function () {
    return this.salary;
  },
};

// add 2 objects together
console.log(John + Lily); // ==> 68000 😃

// calculate 500 + John
console.log(500 + John); // ==> 23500
```

In the `valueOf()` method we are returning the `salary` property value so that when we do numerical calculations with the objects the calculated value of both the salary is returned instead of `[object Object][object Object]`.

Useful! Right? 😃

This also depends on the context you are using to calculate.

Consider adding a string `Hello` to `John` object.

```javascript
// 2 objects
const John = {
  name: "John Doe",
  salary: 23000,
  valueOf: function () {
    return this.salary;
  },
};
const Lily = {
  name: "Lily Rose",
  salary: 45000,
  valueOf: function () {
    return this.salary;
  },
};

// add Hello with John
console.log("Hello" + John); // ==> Hello23000
```

### Feel free to share if you found this useful 😃.

---
How to obtain iOS application logs without Mac
Tags: logs, ios, xcode, iphone
Published: 2020-09-07 12:13:05

---
title: How to obtain iOS application logs without Mac
published: true
date: 2020-07-22 00:00:00 UTC
tags: Logs,iOS,Xcode,iPhone
canonical_url: https://www.loginradius.com/engineering/blog/how-to-obtain-ios-application-logs-without-mac/
---

Logs are very helpful in finding the root cause of the issues you may be experiencing in an app. It is an efficient way to resolve issues by knowing the exact reason after checking Logs. Let's say we have developed an iOS app. As in many situations, we want to test our app on…

   
[Read On](https://www.loginradius.com/engineering/blog/how-to-obtain-ios-application-logs-without-mac/)
React Native Android zIndex, elevation issue with 'absolute' position
Tags: reactnative, android, expo
Published: 2020-07-21 23:56:01

##The issue

I'm pretty new to React Native and different rules of styling has been haunting me for a while. Recently, I tried to make my own Side Drawer Modal simply because react native modal doesn't work on web and I needed to make my app universal (Yes, I'm lazy). Everything seemed to work fine on the web but on Android, my Modal did appear however wasn't organized according to the zIndex I've set up which was supposed to be at the highest level.

##What I tried

Since then, I searched the web and found out that for Android, I actually needed to use elevation property as well which should be higher than the zIndex. It now brought my modal upfront as in display so I thought it worked! Well, not so fast. It seemed to be in front but the components behind it was being interacted and the actual content of modal was acting like a ghost. From this point, I was going frantic. I simply did not know what else I could control.

##The Solution

As many of you might already know and guessed, yes, it was arranging of the components. It seemed like that for Android platform, regardless of the zIndex, elevation, component that comes after a component has higher zIndex. I don't understand just why but that's how it was. All I had to do was moving the Modal component right at the bottom after the main View component (in my case ScrollView).

With experience and right knowledge, I should have tried this earlier, but for someone who might run into similar problem, I hope this helps.
rsync - 10 examples in 11 days (Day 06)
Tags: linux, rsync, bash, tutorial
Published: 2020-07-21 23:52:40

# Day 06

> 10 examples in 11 days

## Add Linux User + Unix date stamp to backup folder

Today's article is a short article I will not talk about an option of **rsync**, is just a useful syntax that we can attach to the backup destination folder.

In [Day 04](https://dev.to/jmr_code_social/rsync-10-examples-in-11-days-day-04-1mkd) I talked about backups and what I will mention today comes very handy when doing backups while synching.

### So, Adding a USER + UNIX TIMESTAMP?

Yes, as you read, adding a linux user can be useful to know who did it and adding a timestamp let's us know when.

Let me show with an example:

1. Let's see what my _Source_, _Destination_ and _Backup_ directories have

```
iamgroot@laptop:~$ ls -F ~/Users
file1.txt  file2.txt  file3.txt
iamgroot@laptop:~$ ls -F ~/Sync
iamgroot@laptop:~$ ls -F ~/backups
```

- Source _~/Users_ has file1.txt, file2.txt and file3.txt
- Destination _~/Sync_ is empty
- Backups _~/backups_ is empty

Let's now add the current linux User (\$USER) separated by a dash unix timestamp to the backup folder

```
iamgroot@laptop:~$ rsync -vhrb --backup-dir='/home/iamgroot/backups/'$(date +$USER-%s) --suffix='.bak' ~/Users/ ~/Sync
sending incremental file list
file1.txt
file2.txt
file3.txt

sent 276 bytes  received 73 bytes  698.00 bytes/sec
total size is 36  speedup is 0.10
```

Let's check each folder again

```
iamgroot@laptop:~$  ls -F ~/Users && printf -- '-%.0s' {1..10}; echo "" && ls -F ~/Sync && printf -- '-%.0s' {1..10}; echo "" && ls -F ~/backups/ && ls -F ~/backups/iamgroot-1595372929/
file1.txt  file2.txt  file3.txt
----------
file1.txt  file2.txt  file3.txt
----------
iamgroot-1595372929/
file1.txt.bak  file2.txt.bak  file3.txt.bak
```

Obviously you can add `$(date +$USER-%s)` as suffix or using how ever you want.

Cool!!!. Now you know a different way to perform a single task

---

Ok, that'll be for today's example, thanks for reading!!!

Follow, ❤ or 🦄
Shorter Way to Upload to Google Cloud Storage (Just Send the Buffer)
Tags: googlecloud, javascript, node
Published: 2020-07-21 23:43:06

Part of my current project is to take a disk image that's uploaded by the user and place it in google cloud storage. This is something that seems like it should be straightforward and it started close to that then moved further in that direction.

I started with this [excellent thorough writeup] (https://medium.com/@olamilekan001/image-upload-with-google-cloud-storage-and-node-js-a1cf9baa1876) and picked out the stuff that helped flesh out the mechanics. I use `express-fileupload` instead of `multer` just because I like it better for no other objective reason I could really name other than the free md5 sum which I use to know which files are duplicates based on their content.

Many of the examples I was seeing used `.createWriteStream()` which is likely a really good "learn the long way first" route. However there's a much simplified version (which is the job of a library) called `.save()`. Your files don't have a content type, but that can be added with a google cloud function (especially if you're already going to do other stuff with it) or a second call to the API after the upload. Thanks to [this thread](https://github.com/googleapis/google-cloud-node/issues/2334) for pointing out this shortcut over three years ago. 

Below is code that's roughly what I use.

```javascript
import Cloud from "@google-cloud/storage";  // currently @5.1.2
const { Storage } = Cloud;

// same storage object for all uploads
const storage = new Storage({
  "keyFilename": "./PATH/MY_GCP_KEY.json"
});

// same bucket for all uploads
const bucket = storage.bucket(MY_BUCKET);

const uploadDiskImage = async file => {
  const { filename, buffer } = file;
  const fileHandle = bucket.file(filename);
  const [ fileExists ] = await fileHandle.exists();
  if (fileExists === false) {
    return fileHandle.save(buffer);
  }
  return new Promise((resolve, reject) => resolve(filename));
};

export default uploadDiskImage;
```

I believe most of it is pretty simple to read which was largely the point of this post. It could probably get simplified quite a bit more (the `.exists()` feels like an area of opportunity), but for now it's not too shabby.
The Legend of Data - Ep.8 - Linear Regression
Tags: python, datascience, machinelearning, beginners
Published: 2020-07-21 23:42:59

---
title: The Legend of Data - Ep.8 - Linear Regression
published: true
description: Starting from this week we will be doing machine learning. Linear regression is considered to be machine learning 101, and from seeing how linear regression works we will have a basic idea of how we can draw conclusions and make predictions with data.
tags: Python, datascience, machinelearning, beginner
---
**Join our [free data science workshop at PyCon Africa](https://t.co/bS4nlglBmh?amp=1)**

Starting from this week we will be doing machine learning. Linear regression is considered to be machine learning 101, and from seeing how linear regression works we will have a basic idea of how we can draw conclusions and make predictions with data.

If you have any questions or any suggestions about which Python or Data Science topics to cover, please leave your comment at my [Twitch channel](https://www.twitch.tv/cheukting_ho)

You can get the slide deck [here](https://slides.com/cheukting_ho/legend-data-pandas1/). The notebook that I used can be found [here](https://github.com/Cheukting/legend_data).
ip2country released
Tags: webdev, rust, docker, github
Published: 2020-07-21 23:40:44

ip2country is a webservice based on rust for ip ➡️ country 🇪🇺 lookup. we make use of that heavily in our games: https://github.com/extrawurst/ip2country

(grab it as docker image ready to go or build from rust code)

# Origin Story:

it's a mess if u are looking for such solutions, since so many try to lure you into paid stuff or slow-as-ass ones (i was using a *go* based one before) and even a rust based one I found on crates.io does something weird eating up 90mb of RAM (for ipv4) while this one is around **8mb** for ipv4 and ipv6.
My self-made Software degree update
Tags: study, career, learning, webdev
Published: 2020-07-21 23:34:06

In my last post I said that I was going to build a software degree for myself. The audacity of my past self. Turns out I ended up doing something different.

![Hold the pain Harold meme](https://i.kym-cdn.com/photos/images/original/000/839/199/8a9.jpg)

As I started reading degree syllabi it became clear to me that that was not what I was looking for, but I came across the [web developer roadmap](https://roadmap.sh/) and decided to use that as a starting point.

What I did was write the topics of the backed developer roadmap that I don't feel comfortable in, or that I know I could improve. Spoiler alert, there were quite a few.

Next I made a list of the books and courses available to me, that can help me learn and get better at those topics. For example, I have a membership to a platform called [Platzi](https://platzi.com/), so I'll be using it. Also, [Khan Academy](https://www.khanacademy.org/), which is a free platform, has courses on Algorithms and web development that I'll be trying as well. 

I decided that at all times I'll have a technical book and a course in progress, from the list I made.

I'll be starting with [Intro to Computational Thinking](https://platzi.com/clases/python-cs/) from Platzi and [Intro to DSA](https://learning.oreilly.com/library/view/codeless-data-structures/9781484257258/) by Armstrong Subero. I'm not sure how long it'll take me to finish them, but I'll be making an update about this on august. 

Thanks for reading and may the odds be ever in your favor!
A better developer with product design
Tags: webdev, discuss, beginners
Published: 2020-07-21 23:29:43

{% youtube ntSjlXiN2cs %}

I became a much better developer when I practiced product design for almost 2 years. I created this YouTube channel, the first video is not scripted and it's still new, but, **what I promise is, if you decide to take this little journey with me, you'll learn some great things from product design**

So what I'm asking for here is just some support from this great community, let's start things together and I'll be happy to get any feedback. 

Again this is not a scripted video, hopefully in the next ones will be scripted so no more guessing and more value to you. 

Join me in this journey and thank you :)))
What is POSIX?
Tags: linux, unix, computerscience, c
Published: 2020-07-21 23:27:43

It sure sounds like a cool name!
POSIX stands for Portable Operating System Interface and is a family of standards, specified by the [IEEE](https://en.wikipedia.org/wiki/Institute_of_Electrical_and_Electronics_Engineers) designed to facilitate application portability across __UNIX__ based systems.

If you wrote your programs to rely on POSIX standards, you'll be able to port them easily among a large family of Unix derivatives.

Honorable mentions of __UNIX SYSTEMS__ : 
![alt text](https://www.howtogeek.com/wp-content/uploads/2014/02/history-of-unix.png)

## *Some of the standards POSIX defines :*
---
1.__C API__

  Greatly extends [STANDARD C](https://en.wikipedia.org/wiki/ANSI_C) with things like:
  * file operations: mkdir, dirname, symlink, readlink, link.
  * networking: socket().
  * memory management: mmap, mlock, mprotect, advise.
  Those APIs also determine the underlying system concepts on which they depend, forcing you to conform.


2.__CLI utilities__

  E.g: cd, ls, echo ...
  Many utilities are direct shell front ends for a corresponding C API functions and some are implemented by Bash as built-ins.


3.__Shell language__

Support for the shell language.
E.g :
```shell
a = 5;
echo "$a"; #to print the variable a.
``` 


4.__Program exit status__ 

ANSI C says 0 or EXIT_SUCCESS for success, EXIT_FAILURE for failure.
what POSIX adds:
* 126: command found but not executable.
* 127: command not found.
* >128: terminated by a signal.


5.__Regular expression__

Support for the two types of regex (BRE/ERE).
E.g :
```shell
echo 'a.1' | grep -E 'a.[[:digit:]]' 
#search for a regex from the piped input 
```


6.__Filenames__

* / is the path separator.
* NUL cannot be used. 
* . is cwd, .. is parent.
* can only contain a-zA-Z0-9._-
HELP: Routing techniques in node server 
Published: 2020-07-21 23:18:37

---
title: HELP: Routing techniques in node server 
published: true
description: implementing routing algorithms in Node.JS
tags: 
//cover_image: https://direct_url_to_image.jpg
---
Hey there everyone, I’m just curious as to how a backend hosted on several VPC’s is able to automatically forward the request efficiently to the the available VPC. How can a similar thing be implemented from scratch in an express based server?
How to redirect to an external url in your React app
Published: 2020-07-21 23:01:01

_(it would be cool if Dev.to integrated with Unsplash.com so folks could add nice cover images..)_

I am building a URL shortener for my own personal use. It's a fun little project that stretches your brain and skills quite a lot, loving it so far.

Today I was looking for ways to redirect to an external URL. My first instinct was to reach out for React-Router-DOM capabilities. I found this post [0] and I started to tinker with `<Redirect to='path' />` [1]. 

It didn't work - I learnt that React-Router-DOM is for routing within the app. As folks in reddit were saying [2], you need to reach out to JS for that: 

```
window.location.href = 'http://domain.com';
```

It worked for me. Please leave a comment if there are better/more elegant ways to do it.

[0] https://dev.to/projectescape/programmatic-navigation-in-react-3p1l
[1] https://reactrouter.com/web/api/Redirect
[2] https://www.reddit.com/r/reactjs/comments/635dkv/redirect_outside_of_application_with_reactrouter/
Reset WSL2 User Password
Published: 2020-07-21 22:40:19

Considering tha you are using Ubuntu on Windows with WSL2.

Tips: If you dont know what is your WSL2 version, you discovery using powershell with the command: wsl -l

In my case, the return was ubuntu-20.04, remove the special characters e you will have the command for version like: ubuntu2004, i will call this of ubuntuversion.

Baby steps
1 - Change the default user to root.
-> Open PowerShell and type: ubuntuversion --default-user root

2 - Change your user password
-> Open your linux bash(your linux version)
-> You will see the user root identified
-> Type: passwd newpassword
-> Type your new password twice
-> Exit from bash

3 - Configuring the default WSL2 user for your user
-> Open PowerShell and type ubuntuversion --default-user username
-> Exit of PowerShell

4 - Testing
-> Open your WSL2 Linux bash and try typing sudo ls
-> Put your new password

5 - Enjoy
I´m Michael Jackson from CyberEduca - https://www.linkedin.com/in/michaeljmoraes
Error 418: I'm a teapot
Tags: webdev
Published: 2020-07-21 22:18:53

---
title: Error 418: I'm a teapot
published: true
description: 
tags: webdev
//cover_image: https://direct_url_to_image.jpg
---
Found this funny error code while looking through MDN docs: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418