Skip to content

Instantly share code, notes, and snippets.

@vifon
vifon / firefox-vanilla
Created April 18, 2019 19:45
Start an absolutely fresh Firefox instance that's self-destruct afterwards
#!/bin/bash
finish() {
rm -rf "$TMP"
exit
}; trap finish EXIT INT TERM
TMP="$(mktemp -d -t prefix.XXXXXX --tmpdir=/tmp)"
env HOME="$TMP" firefox -no-remote "$@"
@vifon
vifon / xpipe
Created July 25, 2020 01:32
Print to stdout each new X11 selection value separated by a single newline
#!/bin/bash
# Print to stdout each new X11 selection value. By default operates
# on "xsel -b". Any passed arguments are used instead of
# "-b" verbatim.
set -o errexit -o nounset -o pipefail
# Set argv to -b (operating on the CLIPBOARD selection) if
@vifon
vifon / find-remains.sh
Created February 23, 2022 16:17
Check for the remains of a program in the most likely places.
#!/usr/bin/env fish
# Check for the remains of a program in the most likely places.
# Useful when testing new software or removing no longer used one.
if command -v exa > /dev/null
set ls exa
else
set ls ls --color=auto
end
@vifon
vifon / ripegrape
Created March 30, 2022 00:18
Ripe Grape - A fzf-based wrapper around ripgrep.
#!/usr/bin/env bash
# Ripe Grape - A fzf-based wrapper around ripgrep.
set -o errexit -o nounset -o pipefail
rg --color=always --line-number --with-filename "$@" \
| fzf --ansi --reverse \
--delimiter=: \
--bind 'ctrl-v:execute(vim +{2} {1})' \