Skip to content

Instantly share code, notes, and snippets.

@vikrum
Last active April 3, 2026 22:23
Show Gist options
  • Select an option

  • Save vikrum/1204173 to your computer and use it in GitHub Desktop.

Select an option

Save vikrum/1204173 to your computer and use it in GitHub Desktop.
Vikrum's Most Excellent Antiques, Curiosities, and Dotfiles
defaults write com.apple.Safari IncludeDebugMenu 1
defaults write com.apple.dock no-bouncing -bool TRUE
defaults write com.apple.notificationcenterui bannerTime 1
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write com.apple.Dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0.01
defaults -currentHost write -globalDomain NSStatusItemSpacing -int 1
defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 1
killall Dock
set nocompatible " OG VIM
set bs=2 " allow backspacing over everything in insert mode
set ai " always set autoindenting on
set viminfo='20,\"50 " read/write a .viminfo file, don't store more than 50 lines of registers
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
" set nohlsearch " Stop the search highlighting
hi Search term=bold ctermfg=0 ctermbg=81
" set vb " Visual bell
syntax on
set noswapfile
set nobackup
set nowb
set encoding=utf-8
set showmatch
set matchtime=2
" rot13
map <F3> ggVGg?
map <F5> :% !xmllint --format -
" Open the file to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
set rnu
au InsertEnter * :set nu
au InsertLeave * :set rnu
au FocusLost * :set nu
au FocusGained * :set rnu
alias gs='git status'
alias gp='git pull'
alias n='cat > /dev/null'
alias Grep='grep'
alias rmdss="find . -type f -name .DS_Store -exec rm '{}' \;"
alias httpd='python -m SimpleHTTPServer'
alias ppjson='python -m json.tool'
alias cn="netstat -n | awk '/^tcp/ {t[$NF]++}END{for(state in t){print state, t[state]} }'"
alias sips='sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n'
alias gips='grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}"'
alias jl="sed 'N;s/\n/ /;'"
alias kbj='for moo in {1..100}; do kill %${moo}; done'
alias nop='pbpaste | pbcopy'
alias chop='tr -s [[:space:]] "\012"'
alias camelchop="sed -e 's|\([A-Z][^A-Z]\)| \1|g' -e 's|\([a-z]\)\([A-Z]\)|\1 \2|g'"
alias lowercase="tr '[A-Z]' '[a-z]'"
alias titlecase='python3 -c "import sys; print(sys.stdin.read().title())"'
alias gpt="git push --tags origin master"
alias gbd="git branch | grep -v master | xargs git branch -D"
alias 4sp="sed -e 's/^/ /'"
alias aphid='node ~/dev/git/firebase-operations/firebase-aphid/aphid.js'
alias ets='date +%s'
alias etms='node -e "console.log(new Date().getTime())"'
alias urldecode='python -c "import sys, urllib as ul; [sys.stdout.write(ul.unquote_plus(l)) for l in sys.stdin]"'
alias urlencode='python -c "import sys, urllib as ul; [sys.stdout.write(ul.quote_plus(l)) for l in sys.stdin]"'
alias shufone="perl -MList::Util=shuffle -e 'print((shuffle<>)[0])'"
alias shufall="perl -MList::Util=shuffle -e 'print(shuffle<>)'"
alias subtract="grep -F -x -v -f "
alias djkeys="jq -r '[paths|map(.|tostring)|join(\".\")]'"
alias titlecasechop='sed "s/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g"'
alias pascalchop='titlecasechop | titlecasechop' # need it twice for adjacent capitals
alias ymlkeys='pascalchop | sed "s/[^[:alpha:]]/ /g" | chop | lowercase | sort | uniq'
alias dockerdownall='docker ps -a -q | xargs -L 1 docker stop'
alias aws='aws2'
alias tffmt='terraform fmt -recursive'
alias unsetaws='unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_SECURITY_TOKEN'
alias plist="plutil -convert xml1 -o - "
alias hh='open "musics://music.apple.com/us/curator/apple-music-hip-hop/976439539?app=music"'
export EDITOR="vi"
export FIGNORE=".svn"
export PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:$PATH
function dockerscrub() {
for moo in `docker ps -a -q|xargs`; do docker stop $moo; done
for moo in `docker ps -a -q|xargs`; do docker rm -vf $moo; done
for moo in `docker images -a -q|xargs`; do docker rmi -f $moo; done
for moo in `docker volume ls -q|xargs`; do docker volume rm -f $moo; done
docker volume prune -f
docker system prune -af
}
function avg() {
awk 'sum += $1 { printf "%.2f\n", sum/NR }' | tail -1
}
function sum() {
awk 'sum += $1 { printf "%.2f\n", sum }' | tail -1
}
function e2d() {
perl -e "print scalar localtime $1"
}
function cf() {
cd $(dirname $1)
}
function deltag() {
git tag -d $1
git push origin :refs/tags/$1
}
function flattenjson() {
jq '[leaf_paths as $path | {"key": $path | join("."), "value": getpath($path)}] | from_entries'
}
set -o vi
GPG_TTY=$(tty)
export GPG_TTY
# eval "$(pyenv init -)"
# eval "$(pyenv virtualenv-init -)"
eval "$(/opt/homebrew/bin/brew shellenv)"
alias buildsundial='rm -rf dist build legacy/sundial/.next/standalone; task cleanup-dist build-legacy-sundial pkg-legacy-twine'
# zsh
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git*' actionformats "%s %r/%S %b %m%u%c "
# show exec time and retval on prompt
# https://unix.stackexchange.com/a/703925
# brew install coreutils for gdate
function preexec() {
timer=$(($(gdate +%s%0N)/1000000))
}
function precmd() {
vcs_info
print $vcs_info_msg_0_
if [ $timer ]; then
now=$(($(gdate +%s%0N)/1000000))
elapsed=$(($now-$timer))
export RPROMPT="%(?..%B(%?%)%b) ${elapsed}ms"
unset timer
fi
}
export HISTFILE="$HOME/.zsh_history"
export HISTSIZE=1234567
export SAVEHIST=$HISTSIZE
setopt EXTENDED_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
alias history='fc -l 1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment