This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # git worktrees enable working with differing dependencies: | |
| # auto-install common dependencies on worktree creation by this | |
| # post-checkout hook; drop insto post-checkout.d with multihook : | |
| # https://gist.github.com/Konfekt/d9e86763b0f3febd7b2f7ca589f6c482 | |
| set -Eeuo pipefail | |
| if ((BASH_VERSINFO[0] > 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4))); then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To make Mise work in MSYS2/Cygwin, see | |
| # https://github.com/jdx/mise/discussions/3961#discussioncomment-16024383 | |
| # -- 1. Locate the mise binary ------------------------------------------ | |
| local mise_bin="" | |
| if [[ -n "$MSYSTEM" ]]; then | |
| # MSYS2 / Cygwin: prefer the Windows-native exe resolved through cygpath | |
| local scoop_shim_dir="$(/usr/bin/cygpath -u "$USERPROFILE")/scoop/shims" | |
| local scoop_mise="${scoop_shim_dir}/mise" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Autorebase feature branches onto main/master without switching your current branch.""" | |
| # Uses https://github.com/Timmmm/autorebase as a reference | |
| from __future__ import annotations | |
| import argparse | |
| import os | |
| import subprocess | |
| import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Ensure a single responsive adb server before running gnirehtet, and prevent | |
| # hangs from stuck or duplicated adb server processes. | |
| # Trace exit on error of program or pipe (or use of undeclared variable). | |
| set -o errtrace -o errexit -o pipefail # -o nounset | |
| # Optionally debug output by supplying TRACE=1. | |
| [[ "${TRACE:-0}" == "1" ]] && set -o xtrace | |
| if ((BASH_VERSINFO[0] > 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4))); then | |
| shopt -s inherit_errexit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Render a local file (or URL) to PNG using Firefox headless screenshot. | |
| # This is often a high-fidelity rasterizer for SVG/HTML/CSS compared to some converters. | |
| set -o errtrace -o errexit -o pipefail | |
| [[ "${TRACE:-0}" == "1" ]] && set -o xtrace | |
| if [[ "${BASH_VERSINFO:-0}" -gt 4 || ( "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 ) ]]; then | |
| shopt -s inherit_errexit | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Purpose: Fast file finding via 'findfunc', with caching and git-aware file listing. | |
| augroup vimrcFind | |
| autocmd! | |
| augroup END | |
| " Scheduling niceness on Linux. | |
| let s:scheduler = has('unix') && executable('chrt') && executable('ionice') ? | |
| \ 'chrt --idle 0 ionice -c2 -n7 ' : '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| View an HTML email with CID-embedded images in w3m from mutt/neomutt using a | |
| macro in muttrc that pipes the whole message to this script such as | |
| macro index l "<pipe-message>mutt-view-html-with-images.py<enter>" "View HTML with images" | |
| Steps performed by the script: | |
| 1. Pipe the raw message to stdin. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # trace exit on error of program or pipe (or use of undeclared variable) | |
| set -o errtrace -o errexit -o pipefail # -o nounset | |
| # optionally debug output by supplying TRACE=1 | |
| [[ "${TRACE:-0}" == "1" ]] && set -o xtrace | |
| if [[ "${BASH_VERSINFO:-0}" -gt 4 || ( "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 ) ]]; then | |
| shopt -s inherit_errexit | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if !has("vim9script") | finish | endif | |
| vim9script | |
| # Adapted from https://github.com/habamax/.vim/blob/7e2bac788a3a6de59356374ea60d90b5dec68b2e/after/ftplugin/markdown.vim | |
| # Markdown header text object | |
| # * inner object is the text between prev section header(excluded) and the next | |
| # section of the same level(excluded) or end of file. | |
| # * an object is the text between prev section header(included) and the next section of the same | |
| # level(excluded) or end of file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env -S uv run --script | |
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [ | |
| # "cryptography>=42", | |
| # ] | |
| # [tool.uv] | |
| # exclude-newer = "2025-12-26 00:00" | |
| # /// |
NewerOlder