teleren/devto huggingface dataset:
Tgraph - A Go package for drawing basic graphics in a terminal
Tags: go, terminal, showdev
Published: 2020-06-09 16:56:28

---
title: Tgraph - A Go package for drawing basic graphics in a terminal
published: true
description: A Go package for drawing basic graphics in a terminal
tags: go,terminal,showdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/a5827iu6iwv232x2vfkp.png
---

I just released a go package for drawing basic graphics in a terminal.

{% github daoleno/tgraph no-readme %}

It supports:

* Bar Graphs
* Multi-variable
* Stacked charts
* Emoji

Package can draw some basic graphics in a terminal like this:

```sh
tgraph data2.csv --title "Most Loved Languages"

Most Loved Languages
        Go: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 86.1
    Kotlin: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 67.1
    Python: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 66.7
      Rust: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 62.9
TypeScript: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 62.3
```

An example using emoji:

```sh
tgraph data2.csv --title "Most Loved Languages" --custom-tick 🔥 --width 30

Most Loved Languages
        Go: 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥 86.1
    Kotlin: 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥 67.1
    Python: 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥 66.7
      Rust: 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥 62.9
TypeScript: 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥 62.3
```

An example with colors:

```sh
tgraph data1.csv --title "Most Loved/Dreaded Languages" --color red,yellow
```
![color graph](https://dev-to-uploads.s3.amazonaws.com/i/qf9q6ijkoiolyxa3c8ac.png)


An example with stacked:

```sh
tgraph data1.csv --title "Most Loved/Dreaded Languages" --color red,yellow --stacked
```

![stacked graph](https://dev-to-uploads.s3.amazonaws.com/i/qf9q6ijkoiolyxa3c8ac.png)
Simultaneous Promises with async/await
Tags: javascript, quicktips
Published: 2020-06-09 16:51:00

I recently got me a membership of [egghead.io](https://egghead.io/?rc=pn8ngk) (this is a referral code) to learn more about web development and all those new technologies. I watched a quick course about async / await and did some notes. These are the ones about sending parallel promises and awaiting them afterwards.
 
## Sending multiple promises at the same time

```js
async displayDevicesAndUsers() => {

	// Since both promises are stored in variables,
	// they are fetched in parallel from the api
	const devicesPromise = fetchApi("devices");	
	const usersPromise = fetchApi("users");
	

	// The results can then be extracted with await
	const devices = await devicesPromise;	
	const user = await userPromise;	
} 

```

## Promise.all
There is also an easier method. You can use `Promise.all`. This will create one promise, that will reserve when all promises in it’s array resolved. The promise will be rejected when one of the promises inside fails. I will use the previous example and refactor it with `Promise.all`

```js
async displayDevicesAndUsers() => {

	// 1st option to retrieve results
	const results = Promise.all([
		fetchApi("devices");
		fetchApi("users");
	]);
	const devices = results[0];
	const users = results[1];

	// 2nd option, which is a little shorter
	// and uses ES2015 array destructuring 
	const [devices, users] = Promise.all([
		fetchFromGitHub("devices");
		fetchFromGitHub("users");
	]);
}
```
2020 Happy Fathers Day Wishes Images
Tags: happyfathersday, happyfatherdayimages, fathersdayimages, 2020fatherdayimages
Published: 2020-06-09 16:45:43

Father is an important part of our life. Father's Day is the day to honor the father. A father-son-daughter relationship is very intimate and this day further strengthens this relationship. Father's Day gives us an opportunity to express our love, appreciation gratitude to the father. This day is an appreciation of the sacrifices of the father worldwide.

Latest Quotes:-

Lovingly carried in the lap,
Become a reason for every happiness.
Happy fathers day!

Happy Father's Day my dear dear father,
My father is in my heart,
For my little pleasure
Father used to say everything!

Every moment of happiness
Passes, When the father is with- Happy fathers day!


"Oh God"
"Everyone like my father"
"Give heart"
"I love you papa"
Happy Father’s Day!

The fun of living life was from the coins you asked for,
"dad" Our earnings do not even meet the needs .. !! Love You Dad ♥ ️ Happy Father’s Day

The father is the Messiah of the family. He is responsible for the well being of the family. Though it is considered special for him everyday, but this day is very special for him to cherish all the hard work done. The day celebrates the love a person feels towards their father and pays tribute to them in a special way. Check more <a href="https://www.happybirthdaywithname.com/happy-fathers-day-wishes-images/">2020 Fathers day wishes images</a>.
The Most Common Cypress Mistakes
Tags: angular, testing
Published: 2020-06-09 16:40:37

Cypress has become the preferred way of doing UI testing of Angular apps by many Angular experts.

It offers great improvements over Selenium based testing tools by making the testing experience more like a real user using the built-in retry mechanism of assertions and commands (eg. click on the element), a user-friendly GUI which makes it easy to trace what is going on in the tests.

But used wrongly, you will still face some of the classic end-to-end/UI test problems such as flakiness and slow test execution.

This post is extending upon the Cypress best practices combined with my experience from helping companies with Cypress testing.

Read more [here](https://christianlydemann.com/the-most-common-cypress-mistakes/).
Deploy your website to Netlify in 2 mins.
Tags: webdev, newbie, tutorial, git
Published: 2020-06-09 16:40:18

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/t75r26oqn8h5bg6kyfju.jpg)
**NETLIFY** is a platform that offers hosting and serverless backend services for web applications and static websites in just a few clicks.
Its completely free for personal projects, hobby sites, or experiments.
 
You can directly deploy your site by dropping the *.HTML* file on Netlify or you can commit your code to Git repository and push it any hosting provider(GitLab, Bitbucket, GitHub). If you don't have a Netlify account then create an account on [Netlify.com](https://app.netlify.com/signup?_ga=2.141314866.1802014871.1591694929-660242810.1588761174) using any Git provider or Email.
<h2>Site from Git</h2>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y17k57j36546np3g66g2.png)
Click on "New site from Git" to get started with your deployed site in the next 3 simple steps.
<h2>Create new site</h2>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rfqik7pwzvxwhfv3gote.png)
You need to choose the Git provider here, for now, let's use GitHub. Netlify will ask you to authorize the access to GitHub, once it is done. You are done with step-1.
<h2>Pick a repository</h2>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dvnn3l0n7i1drlt9h964.png)
Choose the repository you want to deploy and host to Netlify and you are done with step-2.
<h2>Build options, and deploy!</h2>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ttpzaik4x4ju3mivf9dv.png)
To deploy a static website, just click on "Deploy site", no need to specify other options: Build command and publish directory.
Congratulations, the last step is done. Your site is deployed!! 

<h3>Two best things about Netlify</h3>
1. Your site is now available with *URL* provided by Netlify but you can change it to whatever name you want to.
*Go to "site setting" and you are free to change your site name*

2. Netlify has Continuous Deployment, every time you commit changes in your repository Netlify will automatically re-deploy the site.
Being a Beginner, Where Should I start for Automation Testing?
Tags: testing, tutorial, webdev, beginners
Published: 2020-06-09 16:35:10

✅ Join us - https://sendfox.com/thetestingacademy

In this video, We are discussing about the topic Being a Beginner, Where Should I start for Automation Testing?

[![Where Should I start for Automation Testing](https://i.imgur.com/NiUzVV0.png)](https://youtu.be/AQ207Zdhh2k "Where Should I start for Automation Testing") 


✅ How to Learn Automation Testing - https://youtu.be/sVg61q1vpKg

✅ How to Select Right Automation Testing Tool  - https://youtu.be/MLVRlwBFBG4



✅ If you are new consider subscribing and follow day by day to become an Automation Testing expert in 30 days.

🚀 Day 8 Task :  Discussion on How to Start Automation Testing?
🚀 Thread :  https://scrolltest.com/automation/day8
🚀 All Task List : https://scrolltest.com/automation/task
🚀 Watch Full Playlist : https://scrolltest.com/automation/playlist

✅ 5 step method to Start Learning Automation Testing
- Learn Programming
- Familiarity with Automation Tools
- Knowledge and Networking
- Technical Skills
- Knowledge Manual Testing

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

--
Be sure to subscribe for more videos like this!

[![ TheTestingAcademy](https://dev-to-uploads.s3.amazonaws.com/i/r7vcy6wbvyjbk1y1uu0o.png
)](https://www.youtube.com/TheTestingAcademy?sub_confirmation=1 "TheTestingAcademy")
How to convert RoamResearch into a desktop application and any other sites
Tags: knowledge, electron, desktop, javascript
Published: 2020-06-09 16:24:01

Hi guys, 
I'm Davide, founder and web-developer at Sprint Studio, this is my first post here 🤞

Today I would like tell you about a simple hack that could be useful for you ;) 

[RoamResearch](https://roamresearch.com/) is a note-taking app that allow you to write as you think. You could consider it as a second brain where you store your knowledge creating connections between your notes.

In this short and practical post we are going to see how to make RoamResearch a desktop application 😃

### Why convert RoamResearch into a desktop application?

Sometimes we have more tabs in the browser that distracts us from writing. The main goal of convert RoamResearch into a desktop application is: focus on writing, but not only..

One of the next features that the team will be develop is: offline. You could write your notes and save locally on your computer. A desktop application is perfect for this use case .

### Create the application

To do this we have to install nativefier. [Nativefier](https://github.com/jiahaog/nativefier) is a command-line tool that use Electron to wrap the specified site and create a desktop application for your system. The tool create a wrapper of RoamResearch that load the site as a desktop application.

1. Open your terminal and run this command that install globally the package:
`npm install -g nativefier`

You mast have to install Node >= 8 previously

2. When the installation is finished, in your terminal launch this command: 
`nativefier "roamResearch.com"`
3. Wait a minute and you will see a new folder in the working directory, containing the application.
4. Open the folder then open the app
5. Login with username and password
6. Boom, now you have RoamResearch as a desktop application!


👇 **Do you use RoamResearch as a personal knowledge base?**👇


[Click here to the original post](https://blog.sprintstudio.co/blog/convert-roamresearch-into-desktop-application/)
Journey to Machine Learning (Day 004)
Tags: machinelearning, python, datascience, pandas
Published: 2020-06-09 16:21:56

Hello Devs! It's day 4 and once again I'm here to rant! If you wanna read the previous post see here :
[day 001](https://dev.to/aliakberaakash/journey-to-machine-learning-day-001-14n4)
[day 002](https://dev.to/aliakberaakash/journey-to-machine-learning-day-002-3f49)
[day 003](https://dev.to/aliakberaakash/journey-to-machine-learning-day-003-3d2o)

Today I finished the matplotlib section and also read a bit of pandas. I created this beautiful graph in an exercise. It's probably nothing but I'm proud of it :D
![graph](https://raw.githubusercontent.com/AliAkberAakash/Notification-payload/master/gdp%20graph.PNG)

I found some great resources today on machine learning. This [Book](https://github.com/AliAkberAakash/PythonDataScienceHandbook) looks great and it has interractive exercise too. It's completely free so, if you wanna try it go ahead. 

As for leetcode problems I solved [Guess the number](https://leetcode.com/explore/learn/card/binary-search/125/template-i/951/). I also tried to solve [Merge K sorted Arrays](https://leetcode.com/submissions/detail/345714677/) but got stuck and wasn't able to debug it yet. 

I haven't watched Django today till now, but I still have some time left before I call it a day. So I might watch it. 

Yesterday I said that I was gonna drop the math course but I had some time left before going to bed, so I saw a few videos. I might/might not drop it, but this is surely on the last of my priorities for now.

That's pretty much it for today. Hope to write tomorrow again. Thanks for reading! <3
Thoughts on File Transfer over gRPC?
Tags: grpc, go, discuss
Published: 2020-06-09 16:21:07

So, I've been recently fiddling with gRPC and it's various APIs like Client and Server Streaming and tried to implement file transfer over gRPC with Client Streaming. Well, with chunks of size `buf = make([]byte, 1<<21)` and was able to transfer a 224 MB file over tcp tunnel with ngrok (Not an optimal way to test) in 14 minutes. Have anyone tried sending large data over gRPC? If so, what's the throughput? Any implementation on a production level?
The bit-wise similarity between the character cases
Tags: ascii, character, bits
Published: 2020-06-09 16:13:06



**T**he ASCII value of 'a' in binary is 1100001.
The ASCII value of 'A' in binary is 1000001.

Notice the similarity?

The 6th LSB is set for lowercase chars and reset for uppercase chars. Rest all bits are the same.

This can be fun to play around with. For example, you can lower the case by simply doing
```
c | 32
```

And you can toggle the case (that is uppercase to lowercase and vice versa) by:
```
c ^ 32
```

Combining the above two actions, you can upper the case:
```
(c | 32) ^ 32
```

Another point to observe is that the difference between these ASCII values for any uppercase char and corresponding lowercase char is 32.

Oh, and by the way, `man ASCII` provides a nice table for ASCII values.

### The investigation phase
**W**hile doing some crypto exercise, I had a string that was encrypted such that each character of the original string was _XORed_ with some (unknown) character, to form the new character for the encrypted string.
The task was to _decrypt_ and get the original string. Now it is a known fact that the actions of XOR can be reversed by _XORing_ once again with the same number (a character is a number).
```
(a ^ b) ^ b = a ^ (b ^ b) = a ^ 0 = a
```

There are only **128** ASCII character values. So, a simple brute-force, and then by observing the output, you can make out the original string (given that it made sense originally). 

When I experimented with the above logic, with arbitrary character _'x'_, I realized that the decryption made sense 2 times. Once at _'x'_ and the second time at _'X'_. But the thing was, the case had been toggled for _'X'_.

This led to some further investigations, and I came to the above conclusions.
Removing fields with a Rails migration
Tags: ruby, rails, database
Published: 2020-06-09 14:41:53

Over time your Rails models will contain fields that no longer serve a purpose. To make things easier to maintain, you should remove fields that aren't useful. Rails provides an easy way to do this.

In our imaginary system, we have the model `Artist`. When we first made the system, we thought that their eye colour would be a thing we needed. As the system matured, we realised that no one was using this attribute. After speaking to the stakeholders, we decide to remove `eye_colour` from our system.

In our terminal, we can type `rails g migration RemoveEyeColourFromArtists eye_colour:string`

`rails g migration` tells Rails to create a new migration for us. `g` is short for `generate`. If you prefer, you can write `rails generate migration`.

We start with the word `Remove` which tells Rails that this migration is about removing.

`EyeColour` is the field we will be dropping, this names the migration appropriately.

`FromArtists` lets Rails know the table we will be performing the migration on. Note the plural `Artists`, tables are always plural, to indicate they contain many of something.

Finally, we want to describe the field we are removing. It feels weird to define your attribute again, but migrations can have many actions inside them. `eye_colour:string` lets Rails know that the field we will be deleting is `eye_colour` and that it was a `string`.

We don't need to tell Rails it was a string. It will delete any field so long as the name matches. What we gain by giving Rails this extra bit of information is the ability to undo the migration, more on that later.

When we run this command we get this as part of the output;

```
create    db/migrate/20200323105013_remove_eye_colour_from_artists.rb
```

All your migrations will live in `db/migrate/`.

The numbers are the year, month, day, hour, minute, and second we ran the command. This level of specificity helps reduce clashes and helps you to see when you made a migration.

`remove_eye_colour_from_artists` is what we typed in earlier, made lower case and with `_` (snake case is the name for this).

Inside your new migration file, you will see a change method.

```
  def change
    remove_column :artists, :eye_colour, :string
  end
```

The method `change` gets ran when we do a `rails db:migrate` and also when we do `rails db:rollback`. When we do a rollback the opposite of what we ask happens. This is why we set `string` as the data type. When we do `rails db:rollback` Rails will know to recreate the field with the appropriate type.
Introducing the new MongoDB Shell- mongosh
Tags: database, news, php, mongodb
Published: 2020-06-09 16:04:07

Since the beginning, MongoDB has had a shell (mongo), and it has been used for one reason or another by almost everyone who has ever used MongoDB.
The new MongoDB Shell is designed to be expandable, so we can easily add new functionality as new products and services are added to the MongoDB platform, it is embeddable, so you can use it (or parts of it) inside other products (one example is MongoDB for VS Code), and last but not least it provides a modern command-line experience.

***Installation :***
https://docs.mongodb.com/mongodb-shell/install#mdb-shell-install

Features:
![] (https://webassets.mongodb.com/_com_assets/cms/mongosh-1-gxtrhps56r.gif)

**Highlighting the syntax:** making things more readable and facilitating the spotting of errors; 

**Smart autocomplete:** save time when typing, and help when you don't remember a command or an operator; 

**Contextual support:** You can get contextual support for shell classes and commands with direct links to the online documentation when autocomplete is not sufficient; 

**Messages of error:** When something goes wrong.

As you would expect you can run scripts in the MongoDB shell. The MongoDB shell is indeed a very powerful scripting environment. Because it's built on top of the Node.js REPL, you have access to the entire Node.js API and npm package ecosystem. 

Read more on https://www.mongodb.com/blog/post/introducing-the-new-shell

I hope you people like the above article and learned something.
######***IMP REQUEST:***
###### You are most welcome to join my team [ form for joining ](https://forms.gle/pSCALuEWHus3pg9F6).
###### *Also you are most welcome to join OPEN SOURCE INTELLIGENT SYSTEM (OSINT)if you can help in open source project regarding safeguarding humans from various diseases like CORONA outbreak*
######https://github.com/Manishfoodtechs/OSINTHRH/wiki

Contact email: Manishfoodtechs@gmail.com. 

If you have any problem, our team is also engaged in professional consultancy and delivery.


![](https://media2.giphy.com/media/oNrPzIy3OhHm7zrvA3/source.gif)
Your terminal never felt this good before.
Tags: zsh, shell, productivity, tools
Published: 2020-06-09 15:51:36

---
title: Your terminal never felt this good before.
published: true
description: ZSH with some goodies - this is how a terminal should look and feel like - instantly portable <3
tags: zsh, shell, productivity, tools
cover_image: https://kakulukia.github.io/dotfiles/preview.png
---

For the last 5 years I have been building up my shell environment and it's the first thing that gets installed on a new server or Mac. Especially fasd and the reverse history search is a huge time saver.

Some of this stuff I didn't even know was possible before I switched to ZSH or found app X, so I just wanted to share the whole collection. I did a few improvements myself, but basically it was all out there. This repo enables everybody to get all the goodies at once and helps me to feel at home, whenever I open a new shell. 😎

I have prepared a screencast to show you what I mean: https://kakulukia.github.io/dotfiles/

Since most folks still use bash, this can safely be tried out side by side, but you probably might want to stick with it.
A picture book written in C code
Tags: books, c, showdev
Published: 2020-06-09 15:48:28

Hey everyone, I’m writing a unique coding book- it’s a picture book written in C code! The code consists of simple full C programs that represent situations in the story. The illustrations next to the code show the situations. Also, the code is explained below each program. It's called A Day in Code and I recently launched it on Kickstarter:

https://www.kickstarter.com/projects/914595512/a-day-in-code

My aim for the book is to help the reader learn basic programming concepts and logical thinking with real code that describes events in everyday life. I chose C because it’s a foundational language and the most popular language in embedded systems/microcontrollers. 

This is a sample code page:

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

This is the accompanying illustration:

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


I'd love to hear your feedback! 
-Shari