teleren/devto huggingface dataset:
Be the type of person you would like to meet
Tags: selfdevelopment, watercooler
Published: 2020-11-13 04:34:14

 How can you be like the type of person you would like to meet? I have been thinking of people that inspire me and what they have in common. They all have these character traits: courageous, persistant, self-confident and optimistic. Analyzing who inspires you can show you what kind of person you want to be.

So lets break it down into action steps you can do to get closer to your “ideal self”:

1. Write down the people that inspire you most
2. Find their common character traits
3. Pick out a few traits you want to have
4. Write these traits down somewhere you can revisit them regularly
5. Analyze your behaviour by e.g. looking back to your week every Sunday and ask yourself if you acted accordingly to your desired traits
6. If you didn’t act like your ideal self, write down what you can do to match it and act like that next time

Who inspires you and which character traits are you working on? Have a nice day. :)
Self-note: Try this to write a commit message when you're stuck in VIM
Tags: vim, git, programming, commandline
Published: 2020-11-13 03:18:01

Maybe this will help you. 

When git pulling master into a feature branch, you may get this error:

Merge branch 'master' of xxxxxxxx into xxxxxxxxx
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.

Ah, stuck in VIM. 

Here's what I did. It seemed to work.

cntrl x + cntrl v + commit message + :wq

If that doesn't help, try this thread from stackoverflow https://stackoverflow.com/questions/19085807/please-enter-a-commit-message-to-explain-why-this-merge-is-necessary-especially

godspeed
Access your clipboard on your other devices 📋😍
Tags: productivity, windows, showdev, clipboard
Published: 2020-11-13 02:57:50

How many times have you been working on multiple systems and realised you are trying to paste something which you have copied on the other system? Well with the help of this article you can now share your clipboard between your **Windows** and **Mac** devices 😎.

## Windows to Windows

If you have multiple windows devices, it's very easy. Simply open your control panel and search for _Clipboard Settings_.

![Opening clipboard settings on windows](https://dev-to-uploads.s3.amazonaws.com/i/6gx0qrxp9gvxhc6oyabi.jpg)

Once opened, set the **Sync across devices** option to on. If you want to prevent sensitive data to be synced and do it on a case by case basis, set the **Never automatically sync text that I copy** option to on instead.

![Clipboard settings on windows](https://dev-to-uploads.s3.amazonaws.com/i/zwolf1pk0c9s2erc9zf8.JPG)

While you're at it, turn clipboard history on too to have a beautiful clipboard history available by pressing <kbd>Win</kbd>+<kbd>V</kbd>.

![Windows clipboard history](https://dev-to-uploads.s3.amazonaws.com/i/uytculzak075uaww7auc.jpg)

### Use the copied text

Now if you copy something into your clipboard, based on assuming you wanted to sync everything, simply paste, or open your clipboard history on the target device to see it.

> ⚠️ If you selected never automatically sync option, you can press <kbd>Win</kbd>+<kbd>V</kbd> to open up your clipboard history and select what you want to be synced across your devices after copying the items.

### Additional tip

If you choose to use clipboard history, make sure you pin items you use frequently to save yourself some more time too.

![Pin items in clipboard history on windows](https://dev-to-uploads.s3.amazonaws.com/i/0ea3yfayaih3gnffr2ks.jpg)

## Mac to Mac

If you're a Mac user and want to achieve the same, you can use the [Universal Clipboard](https://support.apple.com/en-au/HT209460#:~:text=On%20your%20Mac%3A%20Choose%20Apple,Handoff%2C%20then%20turn%20on%20Handoff.).

It's really simple, like we saw on windows setup.

## Windows/Mac/Linux to Mac/Windows/Linux

If you use two different operating systems and want to simply share your content across, nothing works better than [PASTEBIN](https://pastebin.com/).

This is a web tool that allows you to share your content across different devices with ease.

## Warning

When using third party software whether it's application or web app, never share secrets or your personal information.

## Summary

We saw how to take some simple steps to increase our productivity and access any content we would like across our devices. Hope you benefit from this like I did and see you next time.
Welcome to my Blog!
Tags: student, dotnet, welcome
Published: 2020-11-13 02:41:35

[Cover image by Intricate Explorer](https://unsplash.com/photos/D9VQo3GmapA)
Hi everyone, welcome to my Blog!

I'm Connor Radeloff, a graduating senior at CU Boulder in Colorado majoring in Computer Science. I love C#, but have recently been using Python quite a bit for smaller side projects.

I'm starting this blog for a few reasons. As of recent I think I've been in a bit of a rut regarding coding, and I really need to pick up the pace again. I'm looking for jobs right now, and I need some more projects on my resume! You can't have enough projects.

I also think sometimes I find issues in my projects that I have to find answers to on my own (stack overflow fails me) so I can share my findings here.

I also would like to share my progress, findings, and just general things I've been interested in on here, which might inspire others or give me feedback.

In here I can post things like

```
Code Snippets
``` 
and links to other things I find useful, and things others might find useful as well, like [links to helpful videos.](https://www.youtube.com/watch?v=ggSyF1SVFr4)

I'll have more posts coming soon. Thanks!

![](https://licensebuttons.net/l/by/3.0/88x31.png)
How to use rename unix utility command ?
Tags: unix, hindi, beginners
Published: 2020-11-16 19:46:34

---
title: How to use rename unix utility command ?
published: true
date: 2020-11-13 02:14:37 UTC
tags: #unix #hindi #beginners
canonical_url: https://hmble.dev/blog/how-to-use-rename-unix-utility-command/
---

Aaj hum `rename` command k perl version k baare me padenge.

Hum perl version of `rename` command ka use saare whitespace character ko ek sath remove ya change karne k liye use kar sakte. Lets see an example jaha hum se jyada files jinke name me whitespace hai usse `-` change kaise kar sakte.

Us se pahle lets see how we can install perl version of rename.

## Install rename in Ubuntu

```
$ sudo apt install rename
```

## Install rename in Centos or Fedora

```
$ sudo yum install prename
```

## Install rename in Arch Linux

```
$ sudo pacman -s perl-rename
```

Considering k aapne successfully rename command install kar li ab hum dekhte k hai k batch rename kaise kar sakte.

## Remove whitespace from a filename

```
$ rename 'y/ /-/g' *.txt
```
Apple Silicon for developers?
Tags: discuss
Published: 2020-11-13 01:56:48

It seems that [the performance is great on Apple Silicon macs](https://www.macrumors.com/2020/11/11/m1-macbook-air-first-benchmark/). iOS developer can jump in the new hardware but what about others, like Web developers? [Homebrew is not fully Arm'ed yet](https://github.com/Homebrew/brew/issues/7857) and [CLI tools via terminal app runs through Rosseta](https://twitter.com/mistydemeo/status/1283994489795653632?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1283994489795653632%7Ctwgr%5E&ref_url=https%3A%2F%2Fapplech2.com%2Farchives%2F20200721-intel-only-terminal-launch-shell-through-rosetta.html)?

Then virtualization? [It might be hard at this moment](https://bmalehorn.com/arm-mac/).

And more importantly, our production services are running on x86 servers. It may be a discrepancy between servers and the dev environment.

Or go with VPS+SSH? This doesn't use Apple silicon architecture at all but you can show off your new mac devices to your friends without worrying about the development environment. 

Any thoughts?

P.S. As an indie developer, I created [Online Linux Terminal, Wazaterm](https://www.wazaterm.com) which you just need a browser to have a Linux terminal. You can check this out if you choose VPS+SSH :)
Keep @types/node out of your React project
Tags: todayilearned, typescript
Published: 2020-11-13 01:54:47

---
title: Keep @types/node out of your React project
published: true
description: 
tags: todayilearned, TIL, typescript
//cover_image: https://direct_url_to_image.jpg
---

If you're trying to prevent `@types/node` (or any other global types package) from leaking into your React project, you will probably end up tinkering with your `tsconfig.json` and you'll eventually try disabling implicit type imports altogether like so:
```json
{
  "include": ["src"],
  "compilerOptions": {
    "types": []
  }
}
```

But first, why is `@types/node` leaking into your React components in the first place? Chances are that one of your dev dependencies (eg: `@testing-library/react-native` if you're writing a React Native app) relies on `@types/node` and so it ends up in your `node_modules`.

Normally, that won't be a problem after you put `"types": []` in your `tsconfig.json`, but sometimes that doesn't work, and you commence pulling your hair out.

But then, in a stroke of genius, you decide to use the `--traceResolution` flag when compiling your project:
```sh
yarn tsc -p . --traceResolution --noEmit
```

You scour its logs for the culprit, using `cmd+f` to save yourself some time. A-ha! Turns out a transient dependency (aka an indirect dependency) has a [triple-slash directive](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html) in one of its ambient declarations (aka `.d.ts` modules). Behold!
```ts
/// <reference types="node" />
```

*You screech in terror!*

Now there's only one thing to do. Open a PR and maintain a fork until the dreaded `<reference>` tag is obliterated from this Earth, never to return.
Deploying Ruby on Rails to Heroku, it's Easy!
Published: 2020-11-13 01:46:24

**My Learning Ruby on Rails Video Playlist:** https://www.youtube.com/playlist?list=PLY6oTPmKnKbYlAqVHgzZl5lou54bizdbV

## Setup

This tutorial requires that you've already installed

- ruby
- rails

Create a new rails project

```bash
rails new dogs --api -d postgresql
```

cd into the dogs folder

## Configuring your Database

Assuming you have a local postgres server make sure you write your database.yml like so. Make sure the username and password matches your local postgres user.

```yml
default: &default
  adapter: postgresql
  encoding: unicode
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  # Make sure the below reflects your local postgres user
  port: 5432
  host: localhost
  username: test5
  password: test5

development:
  <<: *default
  database: mice_development

test:
  <<: *default
  database: mice_test

production:
  <<: *default
  url: <%= ENV['DATABASE_URL'] %>
```

Uncomment `gem 'rack-cors'` in your gemfile then run `bundle install`

Edit your config/initializers/cors.rb to look like so. This will allow all origins to make request, customize to your liking.

```ruby
Rails.application.config.middleware.insert_before 0, Rack::Cors do
  allow do
    origins '*'

    resource '*',
      headers: :any,
      methods: [:get, :post, :put, :patch, :delete, :options, :head]
  end
end
```

## Create a quick API

Run the following commands for a basic dogs api...

```rails g scaffold dog name:string age:integer breed:string```

```rails db:migrate```

Add the following in db/seeds.rb

```ruby

Dog.create(name: "Sparky", age: 5, breed: "Bulldog")
Dog.create(name: "Spot", age: 5, breed: "Dalmation")
Dog.create(name: "Goldy", age: 5, breed: "Golden Retriever")

```

run the command ```rails db:seed```

## Test the Api

```rails server```

Go to localhost:3000/dogs to see if our dogs are there, if so we are ready to deploy.

## Deploy to Heroku

- push your code to heroku (make sure the root of the repo is the same folder as the gemfile)
- create a new heroku project and connect it to your github repo
- using the heroku cli run the following commands

```heroku run rails db:migrate --app=youAppName && rails db:seed --app=youAppName```
*make sure to replace yourAppName with the name of your heroku project

That's it, go to https://HEROKUURL/dogs

and you should see your dogs!!!
Split keyboard is awesome!
Tags: keyboard, ergonomics, colemak, qwerty
Published: 2020-11-13 01:40:47

---
title: Split keyboard is awesome!
published: true
description: An update to my journey on transitioning to a new keyboard and a new layout at the same time
tags: keyboard, ergonomics, colemak, qwerty
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/yh2bswbhggks45ce1o8y.jpg
---

Two weeks ago I have assembled my first split keyboard, and I am documenting my transition process here. If you want to read my initial post, here's the link:

[Initial post](https://dev.to/weirdmayo/moving-to-split-keyboard-and-new-layout-5lm)

# Transition complete?

![Image of my current setup](https://dev-to-uploads.s3.amazonaws.com/i/3f7lmrhqmr1jze4t49ea.jpg)

To keep my productivity at work, I would use my regular qwerty keyboard. I would use this keyboard when I didn't have to deal with any deadlines and would just go through a regular routine of [colemak.academy](colemak.academy) every time I would plug this keyboard in. Not anymore though!

Now that I have learned the colemak layout and reached about 30wpm on this keyboard, I decided to just use this keyboard at work as well. I have now unplugged the qwerty keyboard until emergency's, and have dedicated myself to the split keyboard full-time.

# What about Vim?

This is where it gets hard. My Vim muscle memory is completely messed up and I reckon that might affect my productivity for a few days. Despite the challenge I am still committed to using this keyboard.

### Navigation solution

Vim uses hjkl for movement. I decided not to remap those keys in vim and keep them genuine, since if I did, I'd have to remap n e i and o as well, and that sucks.

What I decided to do was to create a second layer in qmk and while I am holding the layer button, I can use arrows for navigation, but those arrows are at the regular hjkl location, so I get the best of both worlds: familiar Vim position and the I can use that same position to operate other apps, like scrolling in the browser.

## Scrolling? What about the knob?

Yes this keyboard has a knob, and you can map it to scroll. The problem is... I broke it during installation. I held my solder next to it for too long and it seems that I have damaged the mechanism, so I will have to purchase a new knob.

## Have you figured out the keyboard mapping?

I am still fiddling around with where to put the special symbols, but for the most part, I have not changed the layout on this thing in a while now.

## What's next?

I will be improving my Colemak typing speed and trying to rewire my brains in Vim, and I will keep you posted!
Linux tools for check disk usage and folders size
Tags: linux, console, filesystem, terminal
Published: 2020-11-13 00:53:00

---
title: Linux tools for check disk usage and folders size
published: true
description: du, df, dutree, duf, ncdu, dust
tags: linux, console, filesystem, terminal
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/75uhnr0ictr9p5lii25n.png
---

### 1. Native ones

`du` - Summarize disk usage of the set of FILEs, recursively for directories.

**Most popular commands:** 
`du -sh /path` - show total summary for a defined path
 
`du -h -d 1 /path` - show directory sizes with custom depth (-d option)

`du -h -d 1 /path | sort -hr` - same as previous, but with sort from largest to lowest

![du output](https://dev-to-uploads.s3.amazonaws.com/i/a578jhqwiggttyyww0tw.png)

`df` - report file system disk space usage

Output result looks like:
![df output](https://dev-to-uploads.s3.amazonaws.com/i/hjsensv5vjv5ujzwuqew.png)


### 2. Dust - Rust-written du improve. 

Show result as a pretty tree with sort (Ascending by default)

Repository: https://github.com/bootandy/dust

![dust](https://dev-to-uploads.s3.amazonaws.com/i/wietast14yrvsjsl0p1g.png)

Output can be limited by depth and reversed from largest to lowest

`dust -r -d 1`

![dust -r -d1](https://dev-to-uploads.s3.amazonaws.com/i/s0w4sszkacpcf00htfzl.png)

Also, it has an interesting feature - showing by file count instead of files size

![dust -fr](https://dev-to-uploads.s3.amazonaws.com/i/jxysbjpxlzv9zvu39nr4.png)


### 3. Ncdu - N-curses du version

Site: https://dev.yorhel.nl/ncdu 

Install on Ubuntu: `apt install ncdu`

Install on ArchLinux: `sudo pacman -S ncdu`


It scans the defined directory, show disk usage, and bring the ability to navigate by child directories 

![ncdu](https://dev-to-uploads.s3.amazonaws.com/i/1mlz71nbp51yic3vfm9n.png)


### 4. Dutree - yet another du alternative, written with rust

Repository: https://github.com/nachoparker/dutree

Installation: `cargo install dutree`

![dutree](https://dev-to-uploads.s3.amazonaws.com/i/hhacmod18fwjtyqb5zp1.png)


### 5. Pydf - df clone written with python

Behavior is similar to native df, but with more pretty colorized output

Repository: https://github.com/garabik/pydf

Install on Ubuntu/Debian: `apt install pydf`

Install on ArchLinux: `sudo pacman -S pydf` 

![pydf](https://dev-to-uploads.s3.amazonaws.com/i/8k0dbkrqdhzpuhfaov70.png)


### 6. Duf - Go-written better df alternative

Repository: https://github.com/muesli/duf

Install on Ubuntu/Debian: `apt install duf`

Install on ArchLinux: `yay -S duf` 

It is really fast, has a pretty look, and has a killer feature - the ability to output as JSON, that can be useful for monitoring

![duf](https://dev-to-uploads.s3.amazonaws.com/i/75uhnr0ictr9p5lii25n.png)


![duf for path](https://dev-to-uploads.s3.amazonaws.com/i/tvj0cxes9ctb6kiagnwg.png)
innerHTML Vs. textContent: The subtle difference.
Tags: javascript, webdev, design, tutorial
Published: 2020-11-13 00:40:39

At first glance, both properties look like they do the same thing.

While `innerHTML` provides a simple and convenient way to create HTML templates as strings and inject them into the DOM [Document Object Model], `textContent` only lets you create plain texts as strings.


Now, let's break it down.



### `textContent` in action:

Say we want to output "I love JavaScript"

```
<p id="output"></p>
 
<script>
    document.getElementById("output").textContent = "I love Javascript";
</script>
```



### `innerHTML` in action:

`innerHTML` can do everything `textContent` can, plus a higher level of DOM manipulation. For instance;

Let's output "_I_ **love** JavaScript"
Note: "I" is Italicised, "love" is bold, and let's assume "JavaScript" is in red

```
<p id="output"></p>
 
<script>
    document.getElementById("output").innerHTML = "<em>I</em> <strong>love</strong> <span style='color: red;'>JavaScript</span>";
</script>
```



### Conclusion: 
`innerHTML` is richer, as you can get more fanciful with it.
But if you only aim to return text content, go ahead with `textContent`.


Hope you find this helpful.

Happy to learn from you.

How would you use these properties?
SSH Config
Tags: ssh, unix, linux
Published: 2021-02-08 13:14:45

---
title: SSH Config
published: true
date: 2020-11-13 00:00:00 UTC
tags: ssh, unix, linux
canonical_url: https://tech.serhatteker.com/post/2020-11/ssh-config/
---

We saw that we can `ssh` into our **vagrant virtual machine** in the post [Add SSH Public Key to Vagrant]:

```bash
$ ssh -i ~/.ssh/id_rsa.pub -p 2222 vagrant@localhost
```

However it is too long to type, right? And if you ssh into a server you should remember the IP, like `173.108.251.102`. There should be an easy way to do that since we all are *lazy* developers (?).

The ssh program on a host receives it's configuration from either the

1. `cli` (as we've seen above),
2. `/etc/ssh/ssh_config` file for global-scope,
3. `~/.ssh/config` file for user-scope.

These files are formatted like below:

For our **local vagrant machine**:

```bash
Host vagrantlocal
  HostName localhost
  Port 2222
  User vagrant
  IdentityFile ~/.ssh/id_rsa.pub
  PasswordAuthentication no
```

For a remote server:

```bash
Host myremoteserver
  HostName 173.108.251.102
  User user
  IdentityFile ~/.ssh/id_rsa.pub
  PasswordAuthentication no
```

And then you can access them via `ssh`:

```bash
# vagrant virtual machine
$ ssh vagrantlocal

# remove server
$ ssh myremoteserver
```

You can see more configuration file options at [Configuration Options].


All done!




[Add SSH Public Key to Vagrant]: https://tech.serhatteker.com/post/2020-11/add-ssh-public-key-to-vagrant/
[Configuration Options]: https://www.ssh.com/ssh/config/#listing-of-client-configuration-options
How to convert a string representation of an integer number to number type in JavaScript?
Tags: javascript
Published: 2020-11-13 00:00:00

---
  title: How to convert a string representation of an integer number to number type in JavaScript?
  published: true
  tags: JavaScript
  date: Fri Nov 13 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/convert-string-integer-to-number-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-9c84931707c2d1b1394e3bafafa5ca0c.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/convert-string-integer-to-number-javascript)
  
To convert a `string` representation of an integer number to a `number` type, you can use the `parseInt()` function in JavaScript.

Consider this string of integer number,

```js
// string with integer number
const str = "45";
```

Let's use the `parseInt()` function and pass the `string` to the function as an argument to convert it to a `number` type like this,

```js
// string with integer number
const str = "45";

// convert to number type
const intNum = parseInt(str);

console.log(intNum); // 45
```

- This function is useful when you want to convert values that are obtained from `url`, `form`, or whichever places where the values will be `string` type and need to be converted to an integer number.

See this example live in [JSBin](https://jsbin.com/gutuxovugo/edit?js,console).

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

---
Typescript & Tailwind Journey Pt. 1
Tags: typescript, tailwindcss, nextjs, react
Published: 2020-11-12 23:57:16

### The Project 
The project that I decided to implement Tailwind and TypeScript is my personal website. My website currently uses Next.js, Contentful CMS, and Bootstrap. The only difference now is that it will be redesigned with Tailwind CSS and it will make use of TypeScript. 
#### New Tech Stack Overview
* Next.js
* Tailwind CSS
* TypeScript
* Contentful CMS

### Tailwind CSS 
A couple days ago I decided I wanted to transition from using Bootstrap to Tailwind CSS. Now there are many CSS frameworks out there I could've gone with but I heard many great things about Tailwind CSS, so I decided to give it a try. 

### TypeScript
It is without a doubt that TypeScript is becoming increasingly popular and in demand. All for good reasons. It is there to yell at you in a good way that there are bugs and errors. This can be extremely useful in catching those pesky bugs before a project is deployed to a production environment. I decided to use this in my journey to learn it more.


### What's Next?
In the next part I will talk about my thoughts on using Tailwind CSS and TypeScript after using them. The drawbacks and advantages that I saw in using them and how it compared to the old tech stack on my personal website. Now off I go to code! :smile: :computer: