Skip to content

Instantly share code, notes, and snippets.

View wzulfikar's full-sized avatar
💭
Set status

Wildan Zulfikar wzulfikar

💭
Set status
View GitHub Profile
@wzulfikar
wzulfikar / docker-ps-vertical
Last active March 14, 2024 13:36
vertical format for docker ps
export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n"
// usage:
docker ps --format="$FORMAT"
@wzulfikar
wzulfikar / .Brewfile
Last active February 3, 2023 18:14
My Brewfile. Generated using `brew bundle dump --global`
tap "assemblyai/assemblyai"
tap "contribsys/faktory"
tap "damascenorafael/tap"
tap "dosco/graphjin"
tap "elastic/tap"
tap "eth-p/software"
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
@wzulfikar
wzulfikar / .aliases
Last active January 20, 2023 21:57
Shell aliases I use every day.
alias zshso="source ~/.zshrc"
alias clr="clear"
alias hist=history
alias ytdl="youtube-dl" # Example: ytdl https://www.youtube.com/watch?v=BBJa32lCaaY
alias graph="graph-easy" # Example: echo '[a],[c]->[b]' | graph --as=boxart
alias pn="pnpm" # Example: pn i (install packages from package.json)
alias cat="bat -p" # Replace cat with bat (plain style)
alias catt="bat" # Use fully styled bat
alias catp="/bin/cat" # Escape hatch to run the original `cat`
@wzulfikar
wzulfikar / books-2023.md
Last active January 19, 2023 14:19
Books - Reading list 2023

📖 Reading List 2023

Goal is to read at least 1 book a month and at max 24 books a year.

Take it slow, enjoy the read, keep the momentum, and learn something. See comments for updates.

▲▼▲

# Month Book Title Skimmed? Reading? Read? Recommended?
@wzulfikar
wzulfikar / abbr.md
Last active January 13, 2023 13:41
abbreviations

Software collaboration

  • PR: Pull request (common in Github)
  • MR: Merge request (common in Gitlab)
  • LGTM: Looks good to me

Software design

  • DICE: Design it twice
  • AHA: Avoid Hasty Abstraction

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns  =          14x L1
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns  =          20x L2
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@wzulfikar
wzulfikar / define-errrors.md
Last active December 26, 2022 23:46
Typescript helper to define errors.
type ErrorFunc<ErrorMap extends Record<string, string>> = <
  Kind extends keyof ErrorMap,
  Args extends [kind: Kind, ctx?: string]
>(...args: Args) => {
  ok: false,
  error: Args[1] extends string ? {
    kind: Args[0],
    message: ErrorMap[Args[0]],
    ctx: Args[1]
@wzulfikar
wzulfikar / logs.md
Last active November 25, 2022 20:36
Logs
flowchart TD
  Notes -.-> Problem-based
  Notes -.-> Observations
  Notes --You are here--> Logs[<strong>Logs</strong>]
  Notes -.-> Challenges
  Notes -.-> Electronics

  click Problem-based "https://gist.github.com/wzulfikar/ba2f58d7aeeb3cf53743316f96f91594"
 click Observations "https://gist.github.com/wzulfikar/2cff9bcd64ba5f15296e0b57ff402f79"
@wzulfikar
wzulfikar / observations.md
Last active November 13, 2022 10:53
Observations. Thoughts.

▲▼▲

This gist is a part of my public notes. Here's the "sitemap" of the notes:

flowchart TD
  Notes -.-> Problem-based
  Notes --You are here--> Observations[<strong>Observations</strong>]
  Notes -.-> Logs
 Notes -.-&gt; Challenges
@wzulfikar
wzulfikar / challenges.md
Last active November 3, 2022 11:46
Self Challenge

Challenges

Self-challenge for self-improvement.

Example of challenge (eg. weekly):

Sun Mon Tue Wed Thu Fri Sat Score
Ch. 1: No screen 30 minutes before sleep
Start Mon, Oct 17, 2022
◻️ ◻️ ◻️ ◻️ ◻️ ◻️ ◻️ A | B | C