-
Fall 2022
-
Chrome Window Lock
I like to have a window full of dashboards open while I work. I never want a new tab to open there. But often if I give it focus, then click a link somewhere, my new tab will end up there.
This Chrome extension lets you lock a window so it will not create tabs there.
-
Summer 2022
-
Lazy Git Bisect
A lot of times, especially during an incident, you want to run git bisect, but often finding a "good" commit is a challenge. I would rather just drop a date into git when I new things were working and deal with a few extra steps during the bisect.
I put these
bash
functions together to provide that functionality.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# call like `bisect_time "2022-07-01"` or just # `bisect_time` to use yesterday's date function bisect_time { since=${1:-$(date -d yesterday '+%Y-%m-%d')} good=$(git log --since="$since" --reverse --format="%H" | head -n 1) echo "HEAD is bad" echo "$good is good" git bisect start HEAD $good echo "use git bisect good/bad to mark commits" } # call like `bisect_time_with_test ./test.sh "2022-07-01"` or just # `bisect_time_with_test ./test.sh` to use yesterday's date function bisect_time_with_test { bisect_time "$2" git bisect run "$1" }
-
Formatting Markdown with code blocks in Vim
I like to keep
textwidth=80
when working on markdown documents so things are easier to read. However, documents with codeblocks often need to be longer. Using the built in format program results in vim constantly formatting your code in ways you didn't intend.The way to solve this problem is to set a different formatter for markdown code. I do this with:
1
autocmd FileType markdown,vimwiki setlocal formatprg=fmtmd textwidth=80
fmtmd
is a small python script that doesn't touch things in multiline code blocks. I have it set up as an executable and available on my path.