Skip to content

Instantly share code, notes, and snippets.

View felipebernardes's full-sized avatar

Felipe Bernardes felipebernardes

View GitHub Profile
@felipebernardes
felipebernardes / gist:a6fe8684dfed2a8c1f0ab8c6f13506a5
Created October 12, 2026 19:20
Prompt for speeding up terminal start-up time
My terminal feels slow to open. Audit my ~/.zshrc and make it start faster.
1. Measure first: time `zsh -i -c exit` a few times, then time each slow-looking
piece on its own (version managers like nvm/rbenv/pyenv/conda, `eval "$(... init)"`
lines, compinit, plugin frameworks, hooks that run on every `cd` or prompt).
Show me a table of what costs what before changing anything.
2. Suggest fixes ranked by time saved, e.g. swapping slow tools for fast drop-ins
(nvm → fnm, pyenv → uv), lazy-loading, caching completions, and removing dead or
duplicate lines. Point out anything risky, like secrets stored in plain text.
3. Before editing, back up the file next to the original with a timestamp in the name.
@felipebernardes
felipebernardes / gist:777d497997db2c481245bf90fe789f00
Created October 2, 2026 13:35
prompt for creating a skill to save disk space by removing unused worktrees
Create a skill called `cleanup-worktrees` that frees disk space by removing git worktrees and local branches for work that's already finished.
**What "finished" means.** A worktree is finished if any of these is true:
- Its ticket in the issue tracker is done, canceled, or a duplicate. This wins no matter what state the PR is in.
- Its PR was merged or closed.
- Its PR is still open but hasn't been touched in 30+ days.
- It has no PR and no commits or file changes in 30+ days.
**What to keep:**
- A worktree with no PR that has been active in the last 30 days. That's work in progress.
@felipebernardes
felipebernardes / .zshrc
Created December 28, 2023 20:23
.zshrc (pikachu theme)
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
cd ~/git
# https://linuxhint.com/change-zsh-prompt-name/
# https://git-scm.com/book/sv/v2/Bilaga-A%3A-Git-in-Other-Environments-Git-in-Zsh
#default prompt
#PROMPT='%K{blue}%n@%m%k %B%F{cyan}%(4~|...|)%3~%F{white} %# %b%f%k'
@felipebernardes
felipebernardes / Makefile
Last active October 2, 2018 15:00
Example/POC of messaging between main js thread and SW thread. 1) download and unzip 2) run 'make start' in your terminal 3) access localhost:1234 in your browser
start:
php -S localhost:1234
const COLORS = {
blue: ['#1E88E5', '#90CAF9'],
brown: ['#6D4C41', '#D7CCC8'],
gray: ['#212121', '#BDBDBD'],
green: ['#388E3C', '#A5D6A7'],
red: ['#E53935', '#EF9A9A'],
orange: ['#F4511E', '#FFAB91'],
purple: ['#8E24AA', '#E1BEE7'],
yellow: ['#FFD600', '#FFF59D'],
}