Skip to content

Instantly share code, notes, and snippets.

@wolf
wolf / get_topics.bash
Created June 1, 2025 13:52
The Bash version of finding all my Bash startup files
# bash
function get_topics() { # get_topics [--print0] : prints the list of topics, in order, to be executed at interactive Bash startup
fd --follow --no-ignore --hidden "$@" --max-depth=1 --type f --extension bash . "${HOME}/.bash_topics.d"
fd --follow --no-ignore --hidden "$@" --type f --extension bash . "${HOME}/.bash_topics.d/$(platform)"
}
@wolf
wolf / readline-edit-mode-changes.txt
Created February 16, 2025 20:08
Show your current readline edit-mode in your Starship prompt
# Some Bash functions and aliases that could go into your .bashrc.
# There's probably way more than you need here. You could reduce this down to just
# just the update function and shorten all names.
function get_readline_edit_mode() {
set -o | (rg --color=never '(emacs|vi)\s+on' -r '$1' || echo "unknown")
}
function update_readline_edit_mode_environment_variable() {
export READLINE_EDIT_MODE=$(get_readline_edit_mode)
#!/usr/bin/env python
# three_doors.py
# experimentally verifies the `three doors' problem
# The Three Doors problem (in short):
# Monty Hall shows the contestant three doors, only one of which leads to something good.
# The contestant selects one of the three doors. Monty then reveals one of the _other_
# doors and the good thing is not behind it (this is always possible). He then asks
# the contestant: "Do you want to keep the door you originally chose? Or would you prefer

Keybase proof

I hereby claim:

  • I am wolf on github.
  • I am wolf (https://keybase.io/wolf) on keybase.
  • I have a public key whose fingerprint is 61B6 7A5F C5AC EFB5 0125 B37D 0A7F 9318 294C F6B1

To claim this, I am signing this object: