teleren/devto huggingface dataset:
DEV posts on Stackbit
Tags: blogging
Published: 2020-06-14 15:09:04

I followed the [DEV post](https://dev.to/connecting-with-stackbit) to build [this site](https://vikrampawar-sb-636a9.netlify.app/?stackbit=3330780793b816842607efd04521fdba7312c396beafd50a06cc3a9ebd79a02b).

Now, any posts I write on DEV will be automatically published to that site. 

I did all this on an iPad.

I was hoping that I’d find a Markdown file for each of my posts. But, the generated repo on GitHub only has Javascript files.  

The next step would be to publish to DEV from a GitHub repo. When I’m on a PC, I prefer to use a text editor to write the posts. I currently have a GitHub pages blog that is automatically generated from a GitHub repo. It would be nice to setup a workflow such that when I post to that repo it is published on DEV as well.
Open source contribution (PR), simultaneously
Tags: git, github
Published: 2020-06-14 15:01:10

So, I thought making an open source contribution is as simple as forking and making a Pull Request; then wait for merging.

I was too naive. Merging might take time from multiple code reviews / corrections. During that, several things may happen.

- The preforked upstream is updated.
- You want to make another pull request unrelated to the old one.

My experience was pretty much sum up here.

{% github https://github.com/umputun/remark42/issues/737#issuecomment-643763558 %}

So, my recommendations are

- After forking, always make a branch. Don't edit / merge `master` branch directly.
- If things get problematic, set `upstream` to the preforked branch.

```sh
git remote add upstream <UPSTREAM_URL>
```

- You mostly have only seen `origin` right? Alternative names such as [`heroku`, `staging`](https://dev.to/patarapolw/how-do-i-create-staging-urls-for-my-webapp-esp-heroku-4dia), or `upstream` can also be used.

- To update your `master` branch to be up-to-date with preforked,

```sh
git fetch upstream
git pull upstream master
```

- To fork directly from `upstream`'s master branch,

```sh
git switch -c <YOUR_PREFERRED_NAME> upstream/master
```

- My thought is also, I can manage multiple unrelated updates this way too. (such as partial monorepo changes, or some commit-type-specific changes.)

Anyone has an experience to share as an open source contributor, about best practices in Git and GitHub?
Fake REST API with JSON and POSTMAN
Published: 2020-06-14 14:51:43

You need back end data to connect with your front end? I will show you how to create fake JSON data with [json-server](https://github.com/typicode/json-server) and [Postman](https://www.postman.com/).

I assume you have your project open, let's type this command to your terminal `npm install -g json-server`

After installation is done create a `db.json` file with some data.
Example:
```
{
  "groceries": [
    {
      "id": 1,
      "item": "bread",
      "amount": "1"
    },
    {
      "id": 2,
      "item": "milk",
      "amount": "3"
    }
   ]
}
```

Start JSON Server `json-server --watch db.json` It should look like this in the browser.

___
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5wvzm9yu3vpd89dzl44a.png)
___
___
I assume you have Postman installed, we will make a GET request.
___
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/z8ks8xgdnl4ny0h2ictb.png)
___
___
Let's add one item with POST request.
___
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rxo3cgcz13bqtpgxnuzk.png)
___

##Pros:
The dummy data is in your version control system
The simplest setup you can imagine
It supports the most used http verbs
It saves changes to your JSON source for POST, PUT, PATCH or DELETE requests.

##Cons:
The payload requires a strict format (JSON)
___


If you are more for a video on how to do it, I highly recommend to watch this [video](https://egghead.io/lessons/javascript-creating-demo-apis-with-json-server)

This is helpful to filter your data.
```
GET ALL GROCERIES
http://localhost:3000/groceries

GET SINGLE GROCERY
http://localhost:3000/grocery/1

PAGINATION & LIMIT
http://localhost:3000/groceries?_page=1&_limit=2

SORTING
http://localhost:3000/groceries?_sort=name&_order=asc

FULL TEXT SEARCH
http://localhost:3000/groceries?q=milk
```
##Dummy data generators
https://github.com/Marak/faker.js
https://github.com/boo1ean/casual
https://github.com/chancejs/chancejs

I hope you will find this article helpful for your future projects.
[Tutorial Git] Puxando commits remotos
Tags: pull, git, merge, womakerscode
Published: 2020-06-14 14:45:44

```
$ git pull
```

- **$** indica que você deve usar o **usuário comum** para fazer essa operação.

O comando **git pull** é um atalho para "puxar" e unir as novas alterações no seu projeto.

Com esse único comando estamos executando o **fetch** seguido do **merge**.

```
git fetch
git merge origin/master
```

Se houver conflitos, aparecerá um aviso informando sobre, para que você possa solucioná-los antes de concluir o **merge**.
Video Tutorial: How to build Social Login with LinkedIn API, OAuth and Node.js - Part 1 
Tags: sociallogin, linkedinapi, node, oauth
Published: 2020-06-14 14:41:52

---
title: Video Tutorial: How to build Social Login with LinkedIn API, OAuth and Node.js - Part 1 
published: true
description: Social Login allows you to improve convenience for your customers and increase conversion rates for your signups and offerings. Instead of letting users fill in forms, they just need to click to sign in with LinkedIn. In this video I
tags: SocialLogin, LinkedinAPI, nodejs, OAuth
canonical_url: https://api-university.com/blog/api-usage/social-login-with-linkedin-part-1/
cover_image: https://api-university.com/wp-content/uploads/2020/06/api-review-splashscreens.001.png
---

Social Login allows you to improve convenience for your customers and increase conversion rates for your signups and offerings. Instead of letting users fill in forms, they just need to click to sign in with LinkedIn.

In this video I show you how you can develop Social Login with LinkedIn, by leveraging the LinkedIn API and LinkedIn OAuth. We will develop a small program in node.js to see OAuth and APIs in practice.

[![Video tutorial on social login with Linkedin API and node.js](http://img.youtube.com/vi/WhKkbpMjSks/0.jpg)](http://www.youtube.com/watch?v=WhKkbpMjSks)


Don’t miss any upcoming episode and [subscribe to the API-University channel](https://www.youtube.com/c/api-university?sub_confirmation=1) on youtube.

This is the first part of a 3 part series on social login:

- Social Login Part 1: [Write code to call the LinkedIn APIs to get profile and email data](https://api-university.com/blog/api-usage/social-login-with-linkedin-part-1).
- Social Login Part 2 (publication scheduled for 2020-06-17): Write code for the redirect endpoint and code for getting an access token[](https://api-university.com/blog/api-usage/social-login-with-linkedin-part-2).
- Social Login Part 3 (publication scheduled for 2020-06-24): Write code to push signup information to a mailinglist provider via API[](https://api-university.com/blog/api-usage/social-login-with-linkedin-part-3).

You might also want to watch: [How to use the LinkedIn API and OAuth](https://api-university.com/blog/api-usage/how-to-use-the-linkedin-api-and-oauth/)



![](https://api-university.com/wp-content/uploads/2020/06/social-login-nodejs-977x1024.png)

In the video, I show you how to write a **node.js application** to call the LinkedIn APIs. It makes your life much easier because it guides you through the process, and helps you to get all the nitty-gritty details right. Without it, you would probably spend a lot of time reading the documentation or figuring it out by trial and error.

[Get the Source Code.](https://api-university.com/blog/api-usage/social-login-with-linkedin-part-1/)

Learn about OAuth in a more structured way, with step-by-step guides:

- [Course on OAuth](https://api-university.com/courses/oauth-2-0-course/)
- [Book on OAuth](https://api-university.com/books/oauth-2-0-book/)
- [Books on other API Topics](https://api-university.com/books/)
- [Courses on other API Topics](https://api-university.com/courses/)
CSS3: Pseudo-Elements
Tags: css, css3, pseudoelements
Published: 2020-06-14 14:32:47

**What is CSS Pseudo-Elements?**
**Are Pseudo-Elements and Pseudo-Classes the same?**

We as UI developers tend to confuse between **Pseudo-Elements (::)** and **Pseudo-Classes (:)**.

Pseudo-elements represent physical element which is not visible in your DOM where as Pseudo-classes represent a state of an HTML element. Both of these features of CSS3 help us write clean HTML code and ultimately simplified DOM. 

Check out this small 10 minutes tutorial to know more about CSS3 Pseudo-Elements.

<a href="http://www.youtube.com/watch?feature=player_embedded&v=YemuN_xqdG4" target="_blank"><img src="http://img.youtube.com/vi/YemuN_xqdG4/0.jpg" alt="CSS3 Pseudo Elements" width="480" height="360" border="10"/></a>


I am a content creator at [**EverydayJavaScript**](https://www.youtube.com/EverydayJavaScript). You can checkout the growing YouTube channel and provide your feedback.
Differences with Default and Named Exports - ES6 JavaScript
Tags: coderarchive, javascript, tutorial
Published: 2020-06-14 14:28:58

In this video, I'll be demonstrating what the differences are when using ES6 exports with Default and Named exports. 

There are some slight differences when using these and it's good to know since popular frameworks like React, Vue, and Angular make use of them! 👌

If you'd like to see more of my videos, [head over to Youtube!](https://www.youtube.com/channel/UCWaB4SBBUCvhYb91fz5Vidg) 

For more content, stay tuned! A follow/sub comes a long way to show support 

Follow and connect with me on:
----------------------------------
🐦 Twitter: https://twitter.com/coderarchive
📚 Github: https://github.com/luvuong-le
💼 LinkedIn: https://www.linkedin.com/in/lu-vuongle/
📷 Instagram: https://www.instagram.com/coderarchive/
📝 Dev.to: https://dev.to/coderarchive
Create/ Publish your first NPM package
Tags: npm, node, codenewbie
Published: 2020-06-14 14:16:48

<b>1. </b>
Create a dir/folder to contain your packages code. 
```bash
mkdir firstnpmpackage
```
<b>2. </b>
change path to dir/folder you just created.
```bash
cd firstnpmpackage
```
<b>3. </b>
Now run ..
```bash
npm init
```
or simply(if you use this command instead npm will not ask you for the details of package and will generate it with defaults)
```bash
npm init -y
```

and fill the required details.

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

<b>4.</b>
Now create an index.js file in this folder, your folder should look like this

<ul><b>firstnpmpackage</b>
<li>index.js</li>
<li>package.json</li>
</ul>

<b>5. </b>
write some code in index.js 
```javascript
#!/usr/bin/env node
function randomNoGenerator(min, max) {
  if(typeof(max) !== 'number' && typeof(min) !== 'number') {
    min = 0;  max = 1;
  }
 console.log(Math.random() * (max-min)) + min;
}
randomNoGenerator(5,10);
```

<b>6. </b>
Now let's modify our package.json a bit to make it work using cli.
```json
"bin":{
   "demoproject" : "index.js"
},
```
just add this thing in your package.json
<b>demoproject </b> is the command you will use to execute your package through cli.
index.js is the file that will be first triggered.
<hr/>
<b>7. </b>
We are all ready to go ,
<i>but wait wait you will really want to test your package locally before publishing it.</i>

Let's do it first :
run
```bash 
sudo npm install -g ./
```
Our package is installed in our local machine now,
Let run it type this in your cli and see the result.
```bash
demoproject
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/95yhei41v3r7b3ag3z03.png)

<hr>
<b>8. </b>
So, now we are done with testing ..
Let's publish it now ,

<b>To make it published you first need to signup on <a href="https://www.npmjs.com/">npmjs.com</a></b>

once you are done signing up!
Run : 
```bash
npm adduser 
```
Give your login credentials..

<b>9. </b>
Now we are ready to go ..
open terminal in your root directory..

and Run :

```bash
npm publish
```

Done.....


*NOTE* : if it gives any error goto package.json and change name of your project any package with same name might be published before...

my github: <a href="https://github.com/deep1144">Deep1144</a>
my npm account: <a hred="https://www.npmjs.com/~deep1144">deep1144</a>

Follow me for more..
Day #4: Finding the smallest positive missing integer from an unordered list using Python.
Tags: python, prolog, beginners
Published: 2020-06-14 13:50:07

Hey, today is the Day 4 of the #100DaysOfCodeChallenge. Received a problem previously asked by Stripe with a hard tag to it.

  

## The Question On Day #4:
Given an array of integers, find the first missing positive integer in **linear time and constant space**. In other words, find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well.

For example, the input `[3, 4, -1, 1]` should give `2`. The input `[1, 2, 0]` should give `3`.


  

## Algorithm

 - Input the given array into a list
 - Filter out all the non-positive numbers from the list.
 - Note that after filtering the non positive elements, the maximum number of positive numbers in the array at the best case can be n, i.e. all the numbers from 1 to n, where n is the length of the positive numbers list.
 - Now we can mark all the numbers greater than n as not required, because the smallest positive number will definitely be in the range of [1,n] or it will be n+1 if all the numbers from 1 to n are in the array.
 - Coming to the core logic, consider an element `v` in the array which is not flag, i.e. it is in the range of [1,n]. Now mark the value at index `v` negative. If the value v is negative, consider its absolute value.
 - Why does this work?
	 - When a element is made negative, it means that the index `i` where it is located, which is a positive integer, exists in the list.
	 - If the positive integer doesn't exist in the list, that particular index remains positive, so when the array is traversed, we can exit at the first positive number encountered and output that index since that is the missing number. 
	 - If the entire array is negative, it means that all the numbers from 1 to n exist in the array, hence the smallest positive number missing is (n+1).
	 
	 
 - **Point to note:** Since index start from 0, it should be kept in mind while negating the numbers and returning the result.

  

**Python Code**  

{% gist https://gist.github.com/nmreddy1911/a829984ff07ccd98a5882f19f493c4ba.js %}

**Output**

    7



Feel free to reach out for any query clearance.
**Thanks and cheers:)**
Relational vs NoSQL databases
Tags: watercooler, discuss, beginners, sql
Published: 2020-06-14 13:43:12

Which one do you prefer between Relational and NoSQL databases?

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

#### - How do you decide which one to use in your job?
#### - Which use cases have you identified on when using a certain kind of database?

Let us know what you think and use in your job!
How to install JDK in Ubuntu 16.04, 18.04, (or) 20.04
Tags: ubuntu, java
Published: 2020-06-14 13:36:55

####Step 1: Update Ubuntu

   *$ sudo apt-get update*

####step 2: Download java jdk file 

  [https://www.oracle.com/java/technologies/javase-jdk14-downloads.html]
Go and Click : Linux compressed archive jdk-14.0.1_linux-x64_bin.tar.gz

####step 3: Go to your downloads path:

  *$ cd Downloads*

####step 4: find your jdk fie and run this command to extract the jdk file 

  *$ ls*
  *$ tar -zxvf  jdk-14.0.1_linux-x64_bin.tar.gz*

####step 5: Go to library file and here we creating java directory

  *$ cd /usr/lib/*
  *$ sudo mkdir java*
 
####step 6: After creating java file move to your jdk file into java directory

  *$ cd ~/Downloads/*
  *$ sudo mv jdk-14.0.1/ /usr/lib/java*

####step 7: Next go to java directory here we are successfully moved jdk file into java directory 

  *$ cd /usr/lib/java/*
  *$ ls*
  out put: jdk-14.0.1
  *$ cd jdk-14.0.1*

####step 8: Next run bellow the commands one by one :
  Note: *14.0.1* is jdk version if in case u r download bellow version like *12.0.1*  plz replace it

  *$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/java/jdk-14.0.1/bin/java" 1*
  *$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/java/jdk-14.0.1/bin/javac"*
  *$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/java/jdk-14.0.1/bin/javaws" 1*

####step 9: Update the JAVA_HOME in your ~/.bashrc

  *$ sudo gedit ~/.bashrc*

  output: 
      ~/.bashrc: executed by bash(1) for non-login shells.
 see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
for examples

If not running interactively, don't do anything...

like this.. go to file last column and add the java home

####step 10: Add Java Home here
      
  #JAVA HOME directory setup
  export JAVA_HOME=/usr/lib/java/jdk-14.0.1
  export PATH="$PATH:$JAVA_HOME/bin"

  click : save 

####step 11: Finally we are install jdk successfully check it 

  *$ javac*
  *$ java*
  *$ java -version*

  out put:
     java version "14.0.1" 2020-04-14
     Java(TM) SE Runtime Environment (build 14.0.1+7)
     Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
Line numbers in `cat` command
Tags: todayilearned, linux, productivity, vim
Published: 2020-06-14 13:23:49


TIL: With extra flag `-n` we can print the line numbers in `cat` command.
(No need to load file in vim for line numbers anymore :) )

### Command
```
$ cat -n filename
```
### Bonus
You can use [`bat`](https://github.com/sharkdp/bat) (as they call it, `cat` with wings), if you want:
1. Syntax Highlighting
2. Line numbers
3. Paging
4. pipe like in cat.
5. etc

- Visit [github profile](https://github.com/jayeshathila/til) for more.
Findfacts Innovation Centre Pvt ltd
Tags: education
Published: 2020-06-14 13:01:24

If you are looking for any of these business solutions : Sales Force Automation, Sales Force Automation Tools on Mobile Apps, Sales Automation crm, Customer Contact Management , Sales & Marketing Automation, Field Force Automation, Service Team Automation, Field Installation & Service Solution, Retail Chain Operation, Promoters & Freelancer Monitoring Solutions, Field Asset Tracking & Audit solution, KYC ( Know Your Customer ) , Field Collection Solution, Field Address Verification Solution, Retail / Mass Distribution Solutions, B2B Sales /Direct Sales Solution, SME/MSME sales & Service solutions, Lead & Funnel Management solutions, Sales Force Effectiveness solutions , Tele calling solutions

https://www.findfacts.in/

Sales Automation Company
Sales force Automation Company
Sales CRM Company
Sales force Management Compan
Sales automation tool
Sales force company
Algorithms Problem Solving: Shuffle the array
Tags: algorithms, python, computerscience, interview
Published: 2020-06-14 12:40:51

---
title: Algorithms Problem Solving: Shuffle the array
published: true
description: Solving algorithms problems with TK
tags: algorithms, python, computerscience, interview
cover_image: https://raw.githubusercontent.com/leandrotk/tk/master/series/algorithms-problem-solving/assets/cards.jpg
canonical_url: https://leandrotk.github.io/tk/series/algorithms-problem-solving/shuffle-the-array.html
series: Algorithms Problem Solving Series
---

This post is part of the [Algorithms Problem Solving](https://leandrotk.github.io/tk/series/algorithms-problem-solving/index.html) series.

## Problem description

This is the [Shuffle the array](https://leetcode.com/problems/shuffle-the-array/) problem. The description looks like this:

Given the array `nums` consisting of `2n` elements in the form `[x1,x2,...,xn,y1,y2,...,yn]`.

*Return the array in the form* `[x1,y1,x2,y2,...,xn,yn]`.

## Examples

```python
Input: nums = [2,5,1,3,4,7], n = 3
Output: [2,3,5,4,1,7]

Input: nums = [1,2,3,4,4,3,2,1], n = 4
Output: [1,4,2,3,3,2,4,1]

Input: nums = [1,1,2,2], n = 2
Output: [1,2,1,2]
```

## Solution

The idea of my solution was to get the first and the last half of the `nums` list. Then iterate through the lists and append one by one.

```python
def shuffle(nums, n):
    first_half = nums[:n]
    last_half = nums[n:]
    final_list = []

    for index in range(len(first_half)):
        final_list.append(first_half[index])
        final_list.append(last_half[index])

    return final_list
```

We could also iterate through the lists simultaneously by using the `zip` function. And append the items in one call, instead of two lines:

```python
def shuffle(nums, n):
    first_half = nums[:n]
    last_half = nums[n:]
    final_list = []
        
    for first, last in zip(first_half, last_half):
        final_list.extend((first, last))
            
    return final_list
```

## Resources

- [Learning Python: From Zero to Hero](https://leandrotk.github.io/tk/2017/09/learning-python-from-zero-to-hero/index.html)
- [Algorithms Problem Solving Series](https://leandrotk.github.io/tk/series/algorithms-problem-solving/index.html)
- [Stack Data Structure](https://leandrotk.github.io/tk/2020/01/stack-data-structure/index.html)
- [Queue Data Structure](https://leandrotk.github.io/tk/2020/01/queue-data-structure/index.html)
- [Linked List](https://leandrotk.github.io/tk/2020/02/linked-list/index.html)
- [Tree Data Structure](https://leandrotk.github.io/tk/2020/02/tree-data-structure/index.html)
What is A Function in Javascript?
Published: 2020-06-14 12:37:30

A JavaScript function is a block of code designed to perform a particular task. A block of reusable code which helps prevent repetition.

###Function Definition
You need to define a function in javascript before using it. We define a function in javascript by writing the **Function** keyword followed by **Function Name**(which can contain letters,numbers,same rules for naming variables also affect it) and bracket which might be empty or contain one or more *parameters* and statement codes which are surrounded by curly braces.

#####Basic syntax for function
function function Name(){

  *//statement of codes

}
The above syntax will not work except you call the function

###Function Invocation
To invoke a function or call a function to execute a statement of codes. You simply write the function name with a pair of brackets outside the curly braces. 

let's write a function to greet a user.

function greet(){
console.log("Hello!!");
}
greet(); *//function invocation

#####Output

Hello!!

###Function Parameter & Argument
We have successfully run a code without including a parameter, it is time to explore parameters and arguments. once you use a parameter for function declaration, you have to use a corresponding argument for the function invocation.

let's update the code above by adding name and age to the function

function greet(name, age){
 console.log("Hello!!"+ name + "you are"+ age +"Years old.");
}
greet("John", 14);


Output
** Hello!! John you are 14 years old.


Awesome we have been able to cover the basics of function. You can simply reuse the code by calling the function multiple times.
 You can try this out on your own by using different ages and names for the above like this:

*greet("Ali", 10);
*greet("Sam", 9);
Netflix clone (HTML & CSS)
Published: 2020-06-14 12:26:51

Finally completed my last project for the "Front-end fundamental" course on pirple.com, I have clone Netflix's homepage just using HTML and CSS, my page is responsive close to the original page. 
I have learned so many concepts of HTML and CSS this week that I strongly recommend all the new coders to take this course, it will boost their motivation.

Here is the <a href="https://nikhiltripathi1.github.io/HTML-CSS-Projects/netflixClone/homepage.html">demo</a>, have a look and please give your suggestions.