Skip to content

Instantly share code, notes, and snippets.

View selckin's full-sized avatar

Thomas Matthijs selckin

View GitHub Profile
#!/usr/bin/env cat
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25
The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.
@selckin
selckin / ccbw
Last active May 18, 2026 13:07
claude/opencode bwrap quick & dirty
#!/usr/bin/env bash
# Require PWD to be a non-hidden subdir of $HOME
# since --bind "$PWD" "$PWD" below grants the sandbox rw access to PWD.
home="${HOME%/}"
pwd_clean="${PWD%/}"
case "$pwd_clean" in
"$home")
err="cannot run in \$HOME itself" ;;
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
awful.key({ modkey, }, "m",
function(c)
c.maximized = not c.maximized
c.maximized_horizontal = c.maximized
c.maximized_vertical = c.maximized
c:raise()
end,
{ description = "maximize", group = "client" }
)
#!/bin/bash
git reflog expire --expire=now --all
git gc --prune=now
#!/bin/bash
# git filter-branch --index-filter 'git rm --ignore-unmatch -r --cached ":(exclude)foo"' --prune-empty -- --all
pattern="$1"
[[ -z ${pattern} ]] && exit 1
git filter-branch --index-filter "git rm --cached --ignore-unmatch ${pattern}" --tag-name-filter cat -f -- --all
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
git reflog expire --expire=now --all
#!/bin/bash
if [[ ! -d .git ]]; then
echo "cwd not a git repo"
exit 1
fi
if [[ ! -f pom.xml ]]; then
echo "cwd has no pom.xml"
exit 1