Skip to content

Instantly share code, notes, and snippets.

@P1N2O
Last active September 8, 2024 10:46
Show Gist options
  • Save P1N2O/872ce635c6172b744101088619f4813c to your computer and use it in GitHub Desktop.
Save P1N2O/872ce635c6172b744101088619f4813c to your computer and use it in GitHub Desktop.
JS Dev Env Setup

JS Dev Env Setup

Interactive

curl -fsSL https://go.pinto.dev/set/env/js | sh

Manual Install

0. Update System

sudo apt update && sudo apt upgrade -y && sudo apt autoremove --purge -y

1. Install and Configure Version Control System

1.1. Add (Official) Git PPA and Install Git

sudo add-apt-repository ppa:git-core/ppa -y && sudo apt update && sudo apt install git -y

1.2. Configure Git

# Set User Name and Email
git config --global user.name "Manuel Pinto" \
&& git config --global user.email p1n2o@pm.me

1.3. Generate SSH Key

ssh-keygen -t rsa -f "$HOME/.ssh/id_rsa" -P "" && cat $HOME/.ssh/id_rsa.pub

Add SSH key to GitHub, GitLab or any other platform

1.4. Generate GPG Key

gpg --full-gen-key \
&& gpg --list-secret-keys --keyid-format LONG p1n2o@pm.me \
&& gpg --armor --export 0123456789 \
&& git config --global user.signingkey 01234567890123456789

Add GPG key to GitHub, GitLab or any other platform


2. Install and Configure JavaScript Runtime's

2.1. Install Node.js

2.1.1. Install Node Version Manager (NVM)
curl -fsSL https://go.pinto.dev/get/nvm | bash
2.1.1. Install Node.js (LTS)
nvm install --lts --reinstall-packages-from=default
Replace --lts with node to install latest node version
Append --reinstall-packages-from=default to update while preserving global packages

2.2. Install Deno

curl -fsSL https://go.pinto.dev/get/deno | bash

2.3. Install Bun

curl -fsSL https://go.pinto.dev/get/bun | bash

3. Terminal Setup

3.1. Install ZSH

sudo apt install zsh -y

3.2. Install Oh My ZSH!

curl -fsSL https://go.pinto.dev/get/omz | bash"

3.3. Install OMZ Plugins

# Auto Suggestions
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Syntax Highlighting
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

3.4. Configure ZSH

nano ~/.zshrc
# Set Bira theme
ZSH_THEME="bira"
# Use plugins
plugins=(zsh-autosuggestions zsh-syntax-highlighting)
#!/bin/bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Get the currently active version
current_version=$(nvm current | sed 's/v//')
# Remove all versions except the current one
for version in $(nvm ls | grep -o 'v[0-9]*\.[0-9]*\.[0-9]*' | sed 's/v//'); do
if [ "$version" != "$current_version" ]; then
nvm uninstall "$version"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment