teleren/devto huggingface dataset:
Understand RxJs mergeMap operator, Today!
Tags: javascript, webdev, beginners, rxjs
Published: 2020-01-19 17:55:32

RxJs is a Javascript implementation of Rx, which is a set of Reactive Programming Extensions. If you are doing Angular today, you have to deal with this on a daily basis. Core features like the Router, the Forms, and much more is heavily based on RxJs and it's _Observable_ implementation.

An operator is simply a function that takes an observable, returns another that it automatically subscribes to and its values get emitted in the original observable stream. There's an special kind of operator, that's commonly known as _flattening operators_.

If the value emitted by the observable is another observable, and you want to handle the _inner_ observable emission as an emission of the _outer_ observable you are gonna need this special kind of operator.

There are 4 flattening operators in RxJs, in this article I'm gonna focus on mergeMap. So, how does it work? 

## Case of study

Imagine you have an observable A that get's called every second and its emission gets mapped to another observable B that takes 5 seconds to complete. 

## Result

If you use mergeMap operator, every second a new instance of observable B will be returned an subscribed to and all these instances will run independently of each other. I like to think they go in parallel.

![Visual representation of mergeMap running](https://thepracticaldev.s3.amazonaws.com/i/pdmgm4i4so7hdpbcfizz.gif)

## Conclusion

I hope this helps you understanding what mergeMap can do for you. I mainly use it when I want to do multiple asynchronous calls that are independent of each other, this way you can reduce the total time spent to the one that lasts longer.
A script to ping the heroku app dyno and prevent it from sleeping
Tags: webdev, bash, opensource, heroku
Published: 2020-01-19 17:42:56

# herokuapp_pinger
A script to ping the heroku app dyno and prevent it  from sleeping, with the notification for linux distros for success and failure

# Repo

https://github.com/sharadcodes/herokuapp_pinger

# SETUP

## Requirements

* crontab
* notify-send
* curl

## STEPS

### First of all clone the repository or download it

Extract the archive file and rename the folder from 
```bash
herokuapp_pinger-master
```
to
```bash
herokuapp_pinger
```

#### Now follow the steps

1. Place the repository folder inside the `home/${USER}/` directory.

	It will look like:
	```bash
	/home/${USER}/herokuapp_pinger/
	```
	
2. Open the script `pinger.sh` inside `herokuapp_pinger` folder with any text editor and replace the DUMMY_USER_NAME on the line 46 with your account name.

2. Go inside the `herokuapp_pinger`	 folder and run

	```
	chmod +x pinger.sh && mkdir logs && mkdir csv_logs
	```
	These two folders will be used to store logs.
	`csv_logs` folder will store logs in the form of CSV files and the `logs` folder will store them with `.log` extension
	
	
3. Add the hosts to the `hosts_list.txt` file inside `herokuapp_pinger/script_data` folder.
    
    **Every host url should be on a new line**
    
    **NOTE: There should be a new empty line after the last host otherwise last entry in the file will not be read**
    
    **ALSO ANY NUMBER OF HOSTS CAN BE SPECIFIED IN THE `hosts_list.txt` file**

4. Setup crontab like this: 
   ```bash
   * * * * * /home/your_user_name/herokuapp_pinger/pinger.sh
   ```
   You should change the crontab schedule according to your needs as 
```
* * * * *
```
will run the script every minute

---

## Your logs will be inside 
```bash
/home/${USER}/herokuapp_pinger/logs/
```
### and
```bash
/home/${USER}/herokuapp_pinger/csv_logs/
```

---

## SETUP FINISHED, ENJOY !
Node-Express⚡REST API for Sending SMS OTP
Tags: javascript, github, opensource, webdev
Published: 2020-01-19 17:34:12


## NodeJS ExpressJS Restful API for Sending SMS

## Quick start

```
$ npm install
```

This will install all the project dependencies


# Details

```
YOUR_API_KEY = FIND THIS API KEY INSIDE https://www.fast2sms.com/dashboard/dev-api 
TARGET_PHONE_NUMBER = 'Target numbers separated by comma, e.g. 8962239013,7773854335'

```

# Optional settings

You can also add these to options variable
```
sender_id -     A custom name for SMS sender
language  -     english / unicode (Unicode supports other languages such as Hindi) 
route     -     qt: Quick transactional
                q: Promotional  
                t: Transactional
variable  -     For 5 characters: 5 = {#AA#} 
                For 10 characters: 10 ={#BB#} 
                For 15 characters: 15 ={#CC#} 
                For 20 characters: 20 ={#DD#} 
                For 25 characters: 25 ={#EE#} 
                For 30 characters: 30 ={#FF#}
variable_value -Your value for the template variable
message   -     If you are using templates message = template_id 
```
You may find your [template_id](https://www.fast2sms.com/dev/quick-templates?authorization=YOUR_AUTHORIZATION_KEY) here 

Check the [GITHUB](https://github.com/realabbas/fast2sms-node-express-rest-api) REPO
Bubble Sort again with JavaScript
Tags: javascript
Published: 2020-01-19 17:28:21

Below code is a sample of the **Bubble Sort** algorithm written in JavaScript.

```js
function bSort(a) { 
    for (let i in a) {
        for (let j = a.length - 1; j > i; j--) {
            if (a[j] < a[j - 1]) { 
                const b = a[j - 1];
                a[j - 1] = a[j];
                a[j] = b;
            } 
        } 
    } 
    return a;
}

bSort([5,3,2,1,4]); // 1, 2, 3, 4, 5
```

That's really easy ☺


But how many people know how it works?



![](https://camo.githubusercontent.com/c6701b79030a3956859c067eeff065812bd00c79/68747470733a2f2f68652d73332e73332e616d617a6f6e6177732e636f6d2f6d656469612f75706c6f6164732f323638323136372e706e67)

![](https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSQJPeKSXVmCv9Q9NvNiuNSItyS00oVJGxMb0XZnWvcwBuXhYWY)

Ok. That's enough...

- Many people know what is Bubble Sort algorithm 
- Many people know how to write JavaScript

There's nothing I can do about it 😇

![](https://i.imgur.com/Q2GjVbS.png)

---
However ... 

If you would like to know again how to write **Bubble Sort** algorithm in JavaScript, 
please watch my video 😉

{% youtube OnTJkqY6HNs %}
Get more type help from VS Code
Tags: javascript, tutorial
Published: 2020-01-19 17:21:44

# Intro
This is a very short tutorial for getting more help on potential Javascript typing errors.

# Type linting
VS Code offers great type inference. However, one of the most powerful feature for JS type linting is disabled by default.

## Linting disabled (default)
![Linting disabled example](https://thepracticaldev.s3.amazonaws.com/i/dkswg15j6d68sci6g7do.PNG)

## Linting enabled
![Linting enabled example](https://thepracticaldev.s3.amazonaws.com/i/tx2p7am8ksi38an6thp1.PNG)

## Enabling linting
Enabling this type check is surprisingly each. All you have to do is go to your **User Settings** and enable **javascript.implicitProjectConfig.checkJs**.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/gmxhwyzokdcbjasnc04s.PNG)

That's it! You've taken a step towards improving your workflow by catching potential type errors.

## More on using types
When writing Javascript, I highly recommend using JSDoc annotations for most of your code for the best type inference experience. With JSDoc, VS Code will be able to provide much better type autocompletion, which makes it easier for you and others to understand and maintain your code.
Check out my other [article on Javascript typings](https://dev.to/henryjw/better-javascript-type-autocomplete-with-jsdoc-3bdo/) if you'd like to learn more about this.
Most Used 10 Terminal Aliases on Linux
Tags: linux, terminal, alias, command
Published: 2020-01-19 17:19:45

In post, i will show you most used 10 Linux terminal aliases.

###What is alias?
Alias is short way of writing commands on terminal.

###How to add aliases?
This process is change according to your command shell.
If you are using bash (mostly used), you can add aliases to `~/.bashrc` file.
If you are using Fish, you an add aliases yo `~/.config/fish/config.fish` file.

**1)** `alias c="clear"` - write **c** for clear

**2)** `alias r="source ~/.bash_profile"` - write **r** for reload bash

**3)** `alias del="rm -rf"` - write **del** for recursive and force removing process.

**4)** `alias untar="tar -zxvf"` write **untar filename** for unpack tar file

**5)** For update commands
`alias update="sudo apt-get update"` for Debian based (Ubuntu...)
`alias update="sudo pacman -Syyu"` for Arch Linux based (Manjaro Linux...)
`alias update="yum update"` for Red Hat based (Fedora, CentOS, RHEL)

**6)** For installing an application
`alias app="sudo apt-get install"` for Debian based
`alias pac="sudo pacman -S"` for Arch Linux based.
`alias app="dnf install"` for RHEL based.

**7)** Git add and commit
`gac "your message"`
`alias gac="git add . && git commit -a -m "`

**8)** Install `node` packages
`nis packagename`
`alias nis="npm install --save"`

**9)** Make and enter inside a directory
`mkcd foldername`
`alias mkcd='foo(){ mkdir -p "$1"; cd "$1" }; foo '`

**10)** Control **cd** command behavior
`alias cd.1="cd .."`
`alias cd.2="cd ../.."`
`alias cd.3="cd ../../.."`
`alias cd.4="cd ../../../.."`
`alias cd.5="cd ../../../../.."`
`alias cd.6="cd ../../../../../.."`
Insecurity and Branching Strategies
Tags: git, gitflow, questions, design
Published: 2020-01-19 15:15:56

---
title: Insecurity and Branching Strategies
published: true
description: Oh don't worry, I see the self-consciousness, honey! 
tags: Git, gitflow, questions, design   
---

Suddenly, you find that you're in front of your mind, looking back at it. It's just standing there, completely halted and unresponsive; staring at seemingly  innocuous slack posts. 

Rolling your mind into a carpet and sliding it down, via your ear, into your head; your mind fills you in on it's distraction:

It really doesn't matter whether you prefer GitHub Flow to Trunk Based Development, or any other branching strategy for that matter. 

Once you're on board with the notion that branching strategies are just specifically applied as a means to mitigate the risks associated with a lack of test automation, "bad team design" or "planning issues", you're already beginning to feel that slow wave of discontent and you're already suspecting there's probably more to it. 

Now that you're not distracted, consider that branching strategies are artefacts of an indulgence in the avoidance of insecurities. Insecurities that come with the responsibility of facing difficult questions.

Now consider the difficult questions

Now face them!
Laravel Vue JS Axios Post Request Example Tutorial
Tags: laravel, vue, axios, httprequest
Published: 2020-01-19 17:12:05

Hi Artisan,

In this tutorial, i will guide you step by step how to create laravel and vue js axios post request example. we will lean how to send http request using axios in vue js. we will send post request with parameter as array or form data in vue js.

axios is a http client library. axios provide to send get, post, put, delete request with parameter, formdata, headers, string, image, multipart/form-data etc. axios is a awesome library for http requests.you can axios git repository and have a look on it. Axios git repository

In this example i will create a simple html form and send post request this data to controller and save them into database. You can also understand clear to how to send http post request.

Link : https://www.codechief.org/article/laravel-vue-js-axios-post-request-example-tutorial
Is worth use frameworks or modules?
Tags: node, frameworks
Published: 2020-01-19 16:48:49

---
title: Is worth use frameworks or modules?
published: true
description: 
tags: node, frameworks
cover_image: https://www.kindpng.com/picc/m/250-2505461_10-preguntas-por-jason-kenney-transparent-questions-clipart.png
---

Hi, this days i was learning node and the NPM system.
I checked a couple of modules to make my develops more faster and im trying to search good practices in node.
I tryed to make an auth system with PassportJS usign roles and the classic "remember me", finally I did it, but learn
all this new system of passport, how it works, how should i call the functions, cookies, sessions... tooks me 3 days.
I made a system like this in plain PHP (no frameworks, just php files and queries) a couple of months ago, and Im pretty sure
I can do the same in node in 1 day, but here's my question.
How worth is it, how worth is learn to use a complex module with bad DOC like passport to implement a simple login system, 
is bad if I made in simple NodeJs? (just connecting to my database and making queries and checking emails and something like that)
Is bad? Is good?
Imagine a enterprise contacts me to build a new login system, should I use passport (with no Sequelize module) or maybe should I use the classic system? (making my own queries, checking...)
How worth is use this modules or frameworks to made simple projects
HTML Grid
Tags: css
Published: 2020-01-19 16:43:39

CSS headaches may pop up at the worst time. So lets take a look at the Grid which is a major tool in the toolkit.

The grid is similar to an invisible partition of any screen size. It allows you to easily create responsive web pages. From a simple 1 column grid to the more complex multiple columns and rows, you can fully control every region of your screen regardless of viewport size.

Here's an example of a complex layout.
It has 9 columns.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/z2vktc5wgmabyq3sd6es.PNG)

Take away: If you have a lot of centered columns and are using the grid for the layout, without anchoring the left side (margin:2em) you will have layout issues when testing different devices. The reason is that as the screen size reduces in width, the first column will slide all the way to the left with no margin.

**The EM and REM**

Any hard-coded widths or heights can stop Responsiveness, use wisely. The em and rem seem to work better than the static pt or px unit, as they are relative units.

Font-sizes work well when specified in the em and or rem unit. Note however, that a font size not applied directly to a text element will affect the entire container. Any container size change may cause other adjustments.

**The Repeat**

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/xk2zh2icqbhr5rrlzdx5.PNG)

If 3 columns are needed then they can be hard-coded.  But the best thing about using the repeat is that the minmax spec. allows a min value, which is the breakpoint for responsiveness, no media queries needed because of how repeat works. The max value of .25fr affected the space between and space around the columns. Its like a width feature for columns.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/pnsmquo3ewn2ezlly0w2.PNG)

Auto-fit is a wonderful way to have the browser decide the column layout within the bounds of minmax.  Combined with a width setting, the columns fit to only 80% of the window.  This is a good way to contrain the outer dimensions of the columns. 

**Grid Areas**

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/9d8aomimjcrluacec29n.PNG)

Strategic section layout. Note that the header is a static relative size, because we only want that height. To hide a row, set height to zero.

**Width and Height**

In the root element, set the Width and Height to 100%. Each grid cell acts as a container and using percentages is relative to that cell.

**Meta tag**

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/37rk7i8j0cpc7ywzoz90.PNG)

 Finallt, set this tag in the root html page of your site.


Yes it's possible to create a responsive web site using only the grid. Each component's overall width and height will affect the overall design. 

Each tweak requires a review to fix any issues created. Press F12 and change device viewports for each you will support (test both vertical and horizontal) directions.

Finally be patient, it takes a while to understand the grid internals.  Keep working at it will become more and more familiar. Over time you will become a layout marvel.
💰Appcoins Android📱 
Tags: beginners, android, javascript
Published: 2020-01-19 16:18:03

Be a part of the Blockchain Revolution

Submit your Apps to the Worlds first Blockchain Distribution Solution

Catappult Support
Unity
Gtarcade 
I GOT GAMES
NETEASEGAMES

Unleash your Apps potential and Reach +250 Million Users:

Aptoide

Cherry Mobile = Philippines Market

MULTILASER = Brazilian Market

Apptoko = Indonesia Market

GIONEE = India , Bangladesh Market

MEIZU 11th Largest 

Blockchain and Appcoins guarantee full transparency to prevent fraud and create a decentralized environment that's easy to use with zero code ...






The initial first step would be to have a debug Apk ready from Phonegap or Cordova Apk build.


To sign the Apk Easily Download:
  https://play.google.com/store/apps/details?id=com.genriko.apksigning

Or

https://play.google.com/store/apps/details?id=com.haibison.apksigner


Verify and choose Apk debug and sign

Note: Haibison Apk Signer builds a jks. Save it to Dropbox or your storage.

The next step Download App Signer (v2)from Shatter Box onto Laptop.
Then using Dropbox on your Laptop as well. 
Submit jks = top of Apk Signer (v2)
Java  = bottom of Apk Signer (v2)

⭐ To generate

The KeyStore will download into your storage. Keep in your Dropbox.

Additional information on process:

https://shatter-box.com/download/apk-signer-tool-v2/

https://catappult.io/en/

https://medium.com/@catappult/how-to-upload-and-certify-apps-in-catappult-685b60e9bf40

Create Account with Catappult and login.

Certifying Apps for Security.

Download dummy Apk from Catappult.

Sign and upload the KeyStore you previously made to Catappult.

Submit icon and all screenshots of your app and promo Video .

Copy and paste your public and private address using Microsoft Word. Print out or download to Dropbox.


Download Appcoins Wallet:

https://play.google.com/store/apps/details?id=com.appcoins.wallet

Wallet info Video
https://youtu.be/H5md5uw2ysl

https://medium.com/@catappult/has-recommended

In App Purchase create and top off your Apps with Appcoins with the public address that was given.
Public key 🔑 for monetization and access to all the IAP purchase in your game. 

Feel free to contact me on DEV for additional questions.
what are the most important SMNs & BMNs for devs in 2020 ?
Tags: smn, bmn, networking, discuss
Published: 2020-01-19 16:11:40

what are the most important SMNs & BMNs for devs in 2020 ?
(4th edition)

SMN
* [deviantart](https://www.deviantart.com/osde8info)
* [instagram](https://www.instagram.com/fsse8info/)
* [pinterest](https://www.pinterest.co.uk/osde8info/)
* [twitch](https://www.twitch.tv/osde8info)
* [twitter](https://twitter.com/osde8info)

COMBOS ?
* [21buttons](https://www.21buttons.com/osde8info)
* [buymeacoffee](https://www.buymeacoffee.com/VbmwyiF)
* [codepen](https://codepen.io/osde8info)
* [devto](https://dev.to/osde8info)
* https://dribbble.com/

BMN
* [github](https://github.com/osde8info)
* [gitlab](https://gitlab.com/osde8info)
* [linkedin](https://www.linkedin.com/in/clivedarra/)

should anything else [BUT NOT THAT ONE] be added or removed from these lists (also please advise in comments below or dm me) 

bonus points for spotting super devious "networking" trick in the links above BTW i hate usage of the word "networking" when people mean "selling" and as a webdev devops syadmin networkadmin person i think the word "networking" should be reserved for tcpip
Ruby is designed for humans
Tags: ruby, webdev
Published: 2020-01-19 15:53:56

---
title: Ruby is designed for humans
published: true
description: The philosophy behind the Ruby programming language
tags: ruby, webdev
---

I just finished reading this [great interview with Matz](https://evrone.com/yukihiro-matsumoto-interview).  It helps build an understanding of his thought process behind the design of the Ruby programming language. Here's a short excerpt.

> People don’t understand the nature of designing a language. Language is kind of a scaffolding of the mind, a way of structuring your thinking. It’s same to human languages, like Russian, Japanese and English.
>
> Programming languages such as Ruby, Python, JavaScript, and so on, help to develop the mind, to allow you to turn ideas into something tangible and useful. That’s the primary purpose of a programming language.
>
> I think a programming language should have a philosophy of helping our thinking, and so Ruby’s focus is on productivity and the joy of programming. Other programming languages, for example, focus instead on simplicity, performance, or something like that. Each programming language has a different philosophy and design. If you feel comfortable with Ruby’s philosophy, that means Ruby is your language.
>
> -Matz

This is the philosophical foundation that I attempted to communicate in my post, [Why I still love Ruby](https://dev.to/hopsoft/why-i-still-love-ruby-2in8). Matz simplifies the message even further. ❤️
At what point is using software like a DEV for ideas no longer OK?
Tags: design, discuss
Published: 2020-01-19 15:51:55

I find myself doing this a fair amount, but there's clearly a point where you have gone too far. I consider decompiling someone else's code too far, along with taking assets that aren't yours, unless you have approval to do so. What about the developer's blog, if there is one? Surely there are other cases I haven't covered? Interested in hearing your thoughts.
how to fix theia (the BYO ide) git not found error
Tags: webdev, ide
Published: 2020-01-19 15:19:56

even if you follow the official (or my) install instructions to the letter to build your own (BYO) theia ide you may get still this error

```
$ ./theia/node_modules/.bin/theia start
root INFO Theia app listening on http://localhost:3000.
root ERROR Error: Git installation not found.
at ./node_modules/find-git-exec/lib/find-git-exec.js:69:69
```

its nothing to be scared of it just means i (or you) forgot to install git 

if you are running linuxliteos or xubuntu just run
```
# aptitude install git
```

then restart theia
Retrieve forgotten password in Android Studio (IntelliJ IDEA)
Tags: actions, tips, androidstudio, ide
Published: 2020-01-19 13:09:04

---
title: Retrieve forgotten password in Android Studio (IntelliJ IDEA)
published: true
date: 2020-01-19 12:01:21 UTC
tags: Actions,tips,android studio,ide
canonical_url: https://esabook.wordpress.com/2020/01/19/retrieve-forgotten-password-in-android-studio-intellij-idea/
---

![Annotation 2020-01-19 183037](https://esabook.files.wordpress.com/2020/01/annotation-2020-01-19-183037.png?w=382&h=311)<figcaption id="caption-attachment-260">No idea, why EYE button is gone?</figcaption>

I was not successfully to seeds _plain password_ from these files, always cryptic with [\*] symbol:

IDE log at `~\user\AndroidStudio\system\log\idea.log*`  
Gradle Task log at `~\projectDir\.gradle\5.4.1\executionHistory\*.bin`  
and anything with `*.bin` extension in this gradle directory, e.g. `taskHistory.bin`

![Annotation 2020-01-19 172555](https://esabook.files.wordpress.com/2020/01/annotation-2020-01-19-172555.png?w=525)

# Mehh,
# What the **HELL** with new Intellij version?????

Let’s find the solution, we can use key manager for my issue:

![Annotation 2020-01-19 172449](https://esabook.files.wordpress.com/2020/01/annotation-2020-01-19-172449.png?w=525)

1. Check it `~\.AndroidStudio3.5\config\*.kdbx`
2. Set `master password`
3. Access with [KeePass](https://keepass.info/) (copy to show only in 12 seconds)
4. DONE

![Annotation 2020-01-19 172341](https://esabook.files.wordpress.com/2020/01/annotation-2020-01-19-172341-1.png?w=525)

![Annotation 2020-01-19 182246](https://esabook.files.wordpress.com/2020/01/annotation-2020-01-19-182246-e1579434980579.png?w=525)

![Annotation 2020-01-19 182215](https://esabook.files.wordpress.com/2020/01/annotation-2020-01-19-182215.png?w=525)