Developer Shortcuts

A cheat sheet for your favorite tools. Master your workflow with these essential commands.

Git

git stashWorkflow

Simpan perubahan sementara dengan git stash dan kembalikan dengan git stash pop.

git commit --amendCommit

Perbaiki commit terakhir dengan git commit --amend tanpa membuat commit baru.

git rebase -i HEAD~nAdvanced

Gunakan git rebase -i HEAD~n untuk mengedit, squash, atau reorder n commit terakhir.

git cherry-pick <hash>Advanced

Ambil commit spesifik dari branch lain dengan git cherry-pick <commit-hash>.

git reset --soft HEAD~1Undo

Batalkan commit terakhir tapi simpan perubahan dengan git reset --soft HEAD~1.

JavaScript

?.Syntax

Gunakan ?. untuk mengakses properti nested tanpa error jika undefined. Contoh: user?.address?.city

??Syntax

Gunakan ?? untuk default value yang hanya berlaku untuk null/undefined, bukan falsy values seperti || operator.

[a, b] = [b, a]Trick

Tukar dua variabel tanpa temp: [a, b] = [b, a]

console.table()Debugging

Gunakan console.table() untuk menampilkan array/object dalam format tabel yang lebih mudah dibaca.

{...obj} / [...arr]Trick

Clone array/object dengan spread: const clone = {...original} atau [...arr]

Linux / Bash

ls -laNavigation

List all files including hidden ones

cd ..Navigation

Go up one directory

grep -r 'text' .Search

Search for text recursively

chmod +x filePermissions

Make file executable

chown user:group filePermissions

Change file owner and group

tar -xvf file.tarArchives

Extract tar file

ps aux | grep processProcess

Find running process

kill -9 PIDProcess

Force kill process

df -hSystem

Show disk usage

topSystem

Display Linux processes

Nmap

nmap <IP>Basic

Scan a single IP address

nmap -sV <IP>Discovery

Detect service versions

nmap -O <IP>Discovery

Detect OS information

nmap -p 80 <IP>Port Scanning

Scan specific port

nmap -p- <IP>Port Scanning

Scan all 65535 ports

nmap -sS <IP>Advanced

TCP SYN scan (Stealth)

nmap -A <IP>Advanced

Aggressive scan (OS, versions, scripts)

nmap -sn <Subnet>Discovery

Ping scan (Host discovery only)

nmap --script vuln <IP>Scripting

Check for common vulnerabilities

VS Code

Ctrl + PNavigation

Quick Open, Go to File

Ctrl + Shift + PGeneral

Show Command Palette

Ctrl + `View

Toggle Terminal

Ctrl + BView

Toggle Sidebar

Ctrl + /Editing

Toggle Line Comment

Alt + Up/DownEditing

Move Line Up/Down

Ctrl + DSelection

Select Next Occurrence

Ctrl + Shift + LSelection

Select All Occurrences

Ctrl + SpaceIntelliSense

Trigger Suggestion

F2Refactoring

Rename Symbol