teleren/devto huggingface dataset:
How to Terminate a Node Process
Published: 2022-02-19 14:43:45

---
title: How to Terminate a Node Process
published: true
date: 2022-02-01 18:10:43 UTC
tags: 
canonical_url: https://codecaliper.me/how-to-terminate-a-node-process
---

You might find yourself managing multiple node processes at the same time while working on a full-stack application. Automated scripts or programs that watch and execute your unit-tests while you code/TDD are possibilities. There is likely Webpack running and serving your frontend on localhost and a node app serving the REST API your frontend is connecting to. Each of these processes would occupy a specific port.

I currently host my React App on localhost:3000 and run my backend on localhost:3001 via serverless offline.

In most cases, you would start those processes from the command line like this:

`npm run react-scripts start` or `sls offline start --port 3001`

If you run those, you can quickly end them with:

`Ctrl + C`

There has been no issue until now. Occasionally, though, you start a process, and then close the IDE or Terminal, and the process continues to run. When you attempt to restart the process, however, you receive an error saying that the port is busy.

The reason or how this happens is that every now and then (weeks or months) I find myself looking up commands that I don't use very often (and that I can google in under 20 seconds), without knowing why or how I did it. Hence, I'll put it here, it might be useful to others as well.

Thanks to an npm package, [kill-port](https://www.npmjs.com/package/kill-port), I got exactly what I needed with a much more user-friendly interface. The npx package is already installed, so I don't need to do anything. All I need to do is:

`npx kill-port 3000`

That's all! Because npx has to temporarily install the kill-port package, it is slower than kill + lsof. However, I can tell you its 100x better. Based on my review of kill-port's source code, it is built on kill + lsof. In my opinion, kill-port provides a more approachable abstraction.

If for some reason you need to install kill-port npm package, you can use the following command:

`npm i kill-port`
How to toggle Polybar on Spectrwm tiling wm
Tags: linux
Published: 2022-02-09 02:42:45

Just a short one on this problem with combination of Spectrwm tiling window manager and Polybar. Managed to sort it out after hours without finding a solution on the web. So here is my hack.

First, the problem... Once you replace the bar that comes with Spectrwm, with Polybar, you have to reserve a portion on top of the screen for Polybar. That's OK, but toggling Polybar leaves that reserved space empty so again you don't get a full screen. On the other hand, if you don't reserve that space, Polybar is displayed above your windows which is also not nice.

My solution is simple:
1. Leave original bar ON with minimal settings, and remove reserved space for Polybar if you had it configured before (`region` in config). Only Spectrwm bar config items you need are:
```
bar_enabled		= 1
bar_border_width	= 0
bar_font		= <any font, just adjust size so bar is as large as Polybar>
bar_format		= ' # <--- something minimal so bar is almost not visible
```

2. make sure your original keybinding to toggle Spectrwm bar is still active (Super+b)

3. install `xdotool`. Miniature program that can send fake keys to Xorg

4. write shell script, I named it `fullscreen-toggle.sh` and put it somewhere (`mine are in ~/scripts/`). Also make it executable:

```
#!/bin/sh
xdotool key super+b
polybar-msg cmd toggle
```
Script is really simple. First, xdotool toggles Spectrwm bar by sending fake keypresses. Then we use polybar-msg to send remote command to Polybar to toggle.

5. Add new keybinding to Spectrwm conf (`~/.spectrwm.comf`). I used MOD+Shift+f:
```
program[toggle_bars] = ~/scripts/fullscreen-toggle.sh
bind[toggle_bars] = MOD+Shift+f
```

... and we're done! Restart Spectrwm (`Super+q`) and try it out. Make sure your keybinding was free before assigning it. Also, try running shell script from terminal for test.
[Azure Trial Hackathon Submission Post Placeholder Title]
Tags: azuretrialhack
Published: 2022-02-09 02:35:13

[Instructions]: # (To submit to the Microsoft Azure Trial Hackathon on DEV, please fill out all sections.)


### Overview of My Submission
[Note]: # (Please make sure the project links to the appropriate GitHub repository, and includes the [Apache-2 permissive license](https://www.apache.org/licenses/LICENSE-2.0)  and README.)


### Submission Category: 

[Note]: # (AI Aces, Computing Captains, Low-Code Legends, Java Jackpot, or Wacky Wildcards:)


### Link to Code on GitHub

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)
[Note]: # (Your repository must include a README)
[Note]: # (You must use and list a permissive license for your code: MIT, Apache-2)


### Additional Resources / Info

[Note:] # Screenshots/demo videos are encouraged!

[Note]: # (Be sure to include the DEV usernames of your collaborators, if any. Prizes for winning projects with multiple collaborators will be sent to the person who posts this submission and they will distribute the prize evenly. DEV will not split prizes as per our rules)

[Reminder]: # (Submissions are due on March 8, 2022 @ 11:59 PM UTC)
Creating AWS S3 Presigned upload and download URL in Python using Boto3
Tags: python, aws, s3, boto3
Published: 2022-02-09 02:33:43

In this video, I'm going to show how to create AWS S3 Presigned upload and download URL in python using boto3

{% youtube MfDZKmL_PNo %}


You can find the code at below gist
https://gist.github.com/arundhaj/134775031ef916301c9aeff4c089466c
preload, eager_load, includes, joins
Tags: rails
Published: 2022-02-09 02:29:08

---
title: preload, eager_load, includes, joins
published: true
description: 
tags: rails
---

## Note
This note is for me.

# Table

| method | prevent N+1 | left outer |
| --- | --- | --- |
| preload | YES | NO |
| eager_load | YES | YES |
| includes | auto | NO |
| joins | NO | NO |
| left_joins | NO | YES |
Basic Syntax of JavaScript
Tags: javascript, webdev, beginners, programming
Published: 2022-02-09 02:11:09


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfx48ld3j54q6ou5zfzi.jpg)
JavaScript can be implemented using JavaScript statements that are placed within the `<script>... </script>` HTML tags in a web page.

You can place the `<script>` tags, containing your JavaScript, anywhere within your web page, but it is normally recommended that you should keep it within the `<head>` tags.

The `<script>` tag alerts the browser program to start interpreting all the text between these tags as a script. A simple syntax of your JavaScript will appear as follows.

```Javascript
<script> 
JavaScipt Code like below.
document.write("Basic Print method in JavaScript"); 
</script> 
```
Basic JavaScript Code:

Let us take a sample example to print out "Hello World". We added an optional HTML comment that surrounds our JavaScript code. This is to save our code from a browser that does not support JavaScript. The comment ends with a "//-->". Here "//" signifies a comment in JavaScript, so we add that to prevent a browser from reading the end of the HTML comment as a piece of JavaScript code. Next, we call a function document.write which writes a string into our HTML document.

This function can be used to write text, HTML, or both. Take a look at the following code.

```Javascript
<html>
   <body>   
      <script language = "javascript" type = "text/javascript">
         <!--
            document.write("The Dev Team!")
         //-->
      </script>      
   </body>
</html>
```

**Output**:
The Dev Team!

Want to learn in Details, you may read in details from [Basic Syntax of JavaScript](https://softcodeon.com/javascript/basic-syntax-of-javascript.htm) here. 

If you have any question to improve this post let's discuss below. Thank you.
Turbine sua forma de codar!
Tags: webdev, programming, computerscience
Published: 2022-02-09 01:58:50

## Você provavelmente usa ou já ouviu falar sobre a ferramenta de desenvolvimento Visual Studio Code(VS Code).

---

Ela é versátil e possui funcionalidades que são essenciais para sua carreira como Dev. Confira!!!

O Visual Studio Code é bem parecido com outros ambientes de desenvolvimento como o Sublime Text, mas sua interface interativa e a facilidade de manipular arquivos tornou ela muito popular entre os Devs do mundo inteiro.

O VS Code como também é conhecido, oferece diversas extensões para turbinar o seu processo de codar, deixando seu trabalho mais divertido e contribuindo para uma melhor qualidade do seu projeto.

Abra seu Visual Studio Code e clique em Extensions ou Extensões no menu lateral esquerdo, agora é só pesquisar as seguintes extensões:

---

**1) Live Server**

Desenvolva um site para Web sem precisar clicar em atualizar toda vez para ver as mudanças do seu código, com o Live Server a mudança é automática e te ajuda a ter uma melhor visão do seu projeto.

---

**2) Material Icon Theme**

Adiciona um pequeno ícone para seus arquivos de desenvolvimento, com essa extensão você terá arquivos mais característicos e terá um ambiente mais estiloso na hora de codar.

---

**3) Beautify**

Seu código fica bagunçado enquanto você vai programando? Com tantas linhas de código fica até difícil editar uma por uma para dar uma visão mais limpa do código. Com a extensão Beautify, a cada salvamento o seu código se organiza e economiza seu tempo na hora de codar.

---

**4) Bracket Pair Colorizer**

Dê estilo a estrutura do seu código, com o Bracket Pair Colorizer, seus parênteses - ( ) e chaves - { } ficam com cores que te ajudam a entender melhor sua sequência de código.

---

**5) Color Highlight**

Adicione um background com a respectiva cor da sua folha de estilo quando codar, independente da cor ser RGB, RGBA ou Hexadecimal. Com o Color Highlight seus arquivos de estilo serão mais característicos.

---

**6) Temas**

Sim! É possível alterar o tema do seu ambiente de desenvolvimento no VS Code, recomendo muito o Dracula Official pelo estilo e principalmente para programar à noite. Existem diversos temas como o Night Owl e One Monokai Theme.

---

Essas são só algumas das extensões que me ajudam muito na hora de codar, fique a vontade para pesquisar e adaptar o seu ambiente de desenvolvimento!

---

**Gostou do conteúdo?** Me siga para mais dicas e conteúdos sobre o mundo da programação e Tecnologia de forma prática. Compartilha com seu amigo Dev que precisa dessa dica!

> _Escrito por Sérgio Bueno,_
Linkedin: [Linkedin](https://www.linkedin.com/in/sergiobsantos)
GitHub: [GitHub](https://github.com/Coastony)
Generate SHA256 Hash on OSX Command Line
Tags: note
Published: 2022-02-09 01:39:22

Just run `echo -n any string | shasum -a 256 | awk '{ print $1 }'`

Fin.

Note
- AWK are not acronym of awkward but it's acronym of the family names of its authors (Alfred Aho, Peter Weinberger, and Brian Kernighan)
- Added `-n` to echo to prevent new line so that we will get the right SHA256 from our input string without newline 😺 (suggestion from @fallenpixel)
Se faça substituível
Tags: devjournal, productivity, career
Published: 2022-02-09 01:32:11

Eu percebi que era substituível e que fazia coisas para ser quando ouvi um dos melhores elogios que recebi até hoje. No meu último dia de trabalho na ThoughtWorks, Renato que trabalhava ao meu lado, me disse que aquele não tinha parecido meu último dia, parecia como qualquer outro.

> Você chegou e trabalhou normalmente, não rolou um desespero de tentar finalizar alguma tarefa ou passar para alguém. E também não estava lá sem fazer nada.

Foi exatamente isso que aconteceu, eu cheguei, abri meu Mac, trabalhei, fiz pair, participei de reuniões. No final do dia, fechei meu computador e a única diferença é que dessa vez não guardei ele, devolvi para a empresa.

---

No novo post do High5Devs eu compartilhei sobre o que acredito em ser substituível, confere lá: http://high5devs.com/2022/02/se-faca-substituivel/
Introduction to Character Code
Published: 2022-02-09 01:27:01


###CHARSET 

A character set refers to the composite number of different characters that are being used and supported by a computer software and hardware. It consists of codes, bit pattern or natural numbers used in defining some particular character. 

A character set may also be referred to as character map, charset or character code 

A character set is created through a process known as encoding i.e. each character is assigned with a unique code or value. 

ASCII characters set is one of the most popular character sets used by general computers to display text or numbers on computer screen 

###ASCII 

ASCII is an abbreviation of American Standard Code For Information Interchange, a standard data-transmission code that is used by smaller and less-powerful computers to represent both textual data (letters, numbers, and punctuation marks) and noninput-device commands (control characters).
It is a  character encoding that uses numeric codes to represent characters. 

####Standard ASCII 

Standard ASCII can represent 128 characters. It uses 7 bits to represent each character since the first bit of the byte is always 0. For Example, a capital "T" is represented by 84, or 01010100 in binary. A lowercase "t" is represented by 116 or 01110100 in binary. For example, the Escape key (ESC) is 27 in ASCII and the Delete key (DEL) is 127. 

###UNICODE
Unicode is a universal character encoding standard that assigns a code to every character and symbol in every language in the world. Since no other encoding standard supports all languages, Unicode is the only encoding standard that ensures that you can retrieve or combine data using any combination of languages







###REFERENCES 
https://techterms.com/definition/ascii
https://www.techopedia.com/definition/941/character-set
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2022-02-09 01:18:15

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week
tags: icymi 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---

_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week._ 



## "Don't judge everyone by the same metric"

@bradstondev explains why they feel coding tests are not the way in this fantastic post.  

{% link https://dev.to/bradstondev/why-i-stopped-interviewing-with-companies-that-require-a-coding-test-2j6n %}

## "Never give up and good luck will find you"

-Falcor from The NeverEnding Story — and @irsayvid on getting an amazing Google internship.

{% link https://dev.to/irsayvid/how-i-got-my-internship-at-google-the-interview-process-with-tips-and-resources-4d3n %}

## Turning ideas into reality

@digitalgreyhat enjoys setting "unattainable goals" each year. 2022 is no exception, but we believe in their ability to form a startup from scratch!

{% link https://dev.to/digitalgreyhat/month-1-building-a-startup-from-scratch-2n8b %}

## Flexibility and functionality

... with the Angular Router. Thanks, @brandontroberts! 

{% link https://dev.to/brandontroberts/setting-page-titles-natively-with-the-angular-router-393j %}

## Hydrate, hydrate, hydrate 🚰 

@ryansolid explores the topic of hydration in JavaScript, from progressive hydration to partial hydration and beyond.

{% link https://dev.to/this-is-learning/why-efficient-hydration-in-javascript-frameworks-is-so-challenging-1ca3 %}


## There are no bad questions, but there are great questions

@vaarun_sinha has some helpful tips on how to ask clear and actionable questions as a developer — a very important skill in this field!

{% link https://dev.to/vaarun_sinha/the-art-of-asking-good-questions-lkd %}

## The ABCs of RBAC

@rschwabco walks through some of the ways to implement an RBAC (Role-Based Access Control) pattern in a Node.js application. We learned a lot from this post and think you will, too!

{% link https://dev.to/rschwabco/building-rbac-in-node-3hcb %}


_That's it for our weekly Top 7 for this Tuesday! Keep an eye on dev.to this week for daily content and discussions...and be sure to keep an eye on this series in the future. You might just be in it!_
100 días de código: 68, avances con primer proyecto de typescript
Tags: spanish, typescript, webdev, 100daysofcode
Published: 2022-02-09 00:03:14

¡Hey hey hey!

Hoy he estado algo ocupado con algunas otras actividades asi que haré esto rápido y conciso.

### Hoy
- Avance con el proyecto de prueba de typescript [finance](https://github.com/Darito97/finance)
- Practique touch typing
- Practique un poco para entrevistas

Espero que tengan mucho éxito en sus proyectos y ¡animo con todo!

Hasta la próxima.

Foto cover de [Sharon Cho](https://unsplash.com/@sharoncho?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) en [Unsplash](https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)
React Native Cookie Guessing Game
Tags: reactnative, react, javascript, webdev
Published: 2022-02-09 01:11:31

# Description

Using React Native I aimed to create an IOS and Android compatible app that lets a user play a game, How Many Cookies In The Cookie Jar, with the computer in which the user picks a number and the computer has to guess which number the user picked. Below I have created various videos where I aim to explain the functionality of the application by diving into the code. 

GitHub repo --> https://github.com/wgotterer/react-native-number-guessing

# General Walkthrough
{% youtube SWLS1ov4K8w %}

# App.js Walkthrough

 {% youtube CZXN_QYpjv8 %}

# StartScreen.js 1 Walkthrough

{% youtube X2-EvfPKBzg %}

# StartScreen.js 2 Walkthrough

{% youtube K6f97_V85RE %}

# GameScreen.js Walkthrough

{% youtube GXsFTVds43A %}

https://youtu.be/GXsFTVds43A

# GameOverScreen.js Walkthrough

{% youtube x11zD_60Kk4 %}

### Resources

https://www.udemy.com/course/react-native-the-practical-guide/

https://reactnative.dev/docs/getting-started
DIGITAL MARKETING FORUM
Tags: congratulations, business, finace, profit
Published: 2022-02-09 00:24:32

**Congratulations to those who benefited from out platform this week 
Never depend on a single income
I can still help more 30 people earn $8000 in 7days,but you will pay me 20% when you recieve it 
No scam
Ask me how?
WhatsApp ‪+1 (782) 800‑6361‬******
what are the best paintball pistols?
Published: 2022-02-09 00:02:29

Even if you are a regular player, you may know how many types and models of paintball pistols are available in the market today. When so many options are presented to someone, an overwhelming feeling is bound to take over. In the middle of all this, people often make the wrong choices. We are here to guide you towards the best paintball pistols according to your requirements. We will make sure that you do not waste your money on something that is not valuable enough.
Buying paintball pistols is your best way to enter into a whole new world of exciting and lovely times with your friends. Purchasing the right paintball can be quite beneficial for your game as it allows you to perform better than the others. If you want to come first in most of your games and shine in their field, the following suggestions can be useful for you to purchase the best one from [best paintball pistols](https://paintballfire.com/best-paintball-pistols/).
Take the Reader Survey
Published: 2022-02-09 18:57:51

---
title: Take the Reader Survey
published: true
date: 2022-02-09 00:00:00 UTC
tags: 
canonical_url: https://jhall.io/archive/2022/02/09/take-the-reader-survey/
---

Since this list has been running for a year now, I thought it might be a nice time to conduct a reader survey. What topics do you find most interesting? How could I improve this content? And a few other bits.

Also, I’ll use some of the (anonymous) stats for an upcoming post or two about surveys in general… more on that later!

Whether you read this via email, or social media, or someone sent you this on a post card, I’d love to hear your feedback.

Here’s the link:

[Take the Survey »](https://forms.gle/REN35ECoynKmJ3Wm9)

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
How to convert a string literal type into a lowercase format in TypeScript?
Tags: typescript
Published: 2022-02-09 00:00:00

---
  title: How to convert a string literal type into a lowercase format in TypeScript?
  published: true
  tags: TypeScript
  date: Wed Feb 09 2022 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/convert-string-literal-type-lowercase-format-typescript
  cover_image: https://melvingeorge.me/_next/static/images/main-e6627741fde6b48269e1a91675578f9e.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/convert-string-literal-type-lowercase-format-typescript)
  
To convert a string literal type into a lowercase format, you can use the built-in `Lowercase` type that comes with TypeScript.

### TL;DR

```ts
// string literal type
type Greeting = "Hi, How Are you?";

// convert string literal type
// into lowercase format
type GreetingLowercase = Lowercase<Greeting>; // hi, how are you?
```

For example, let's say we have a string literal type like this,

```ts
// string literal type
type Greeting = "Hi, How Are you?";
```

Now to convert the string literal type into lowercase let's use the `Lowercase` built-in type and pass the `Greeting` type into it using the angled bracket (`<>`) syntax.

It can be done like this,

```ts
// string literal type
type Greeting = "Hi, How Are you?";

// convert string literal type
// into lowercase format
type GreetingLowercase = Lowercase<Greeting>; // hi, how are you?
```

Now if you hover over the `GreetingLowercase` type you can see that the `Hi, How Are you?` string literal type is now converted into a lowercase format. Yay 🥳.

See the above code live in [codesandbox](https://codesandbox.io/s/convert-string-literal-type-lowercase-format-typescript-he8ltv?file=/src/index.ts).

That's all 😃!

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

---
10+ New Translations on NT Games
Tags: javascript, webdev, icelite
Published: 2022-02-08 23:51:17

The NT Games team are getting ready for a big week of coding.
We are releasing 15+ website translations, and 2 region websites.

List of upcoming languages:
Chinese (Mandarin, Taiwan)
Chinese (Traditional)
French
Hebrew
Spanish
Celtic
Portuguese
Japanese
Russian

Upcoming Region Websites:
CH - NT China
UK - NT Games UK