Skip to content

Instantly share code, notes, and snippets.

@antlis
antlis / brave-history-fzf.sh
Created April 16, 2026 20:05
A small shell utility for interactively searching and opening browsing history from Brave Browser (Beta) using fzf. It queries the local SQLite history database, presents a clean, colorized list of titles and URLs, and allows multi-selection to open multiple pages at once. Designed for fast keyboard-driven workflows.
brave-beta-history() {
local cols sep brave_history open
cols=$(( COLUMNS / 3 ))
sep='{::}'
if [ "$(uname)" = "Darwin" ]; then
brave_history="$HOME/Library/Application Support/BraveSoftware/Brave-Browser-Beta/Default/History"
open=open
else
brave_history="$HOME/.config/BraveSoftware/Brave-Browser-Beta/Default/History"
@antlis
antlis / fh.sh
Created April 16, 2026 19:56
Interactive shell history search and execute using fzf. Lets you fuzzy-search your command history, select an entry, and immediately execute it. Works with both Bash and Zsh. Useful for quickly re-running complex or long commands without retyping.
fzf-history-exec() {
local cmd
if [[ -n "$ZSH_NAME" ]]; then
cmd=$(fc -l 1 | fzf --tac | sed 's/^[[:space:]]*[0-9]\+[[:space:]]*//')
else
cmd=$(history | fzf --tac | sed 's/^[[:space:]]*[0-9]\+[[:space:]]*//')
fi
[[ -z "$cmd" ]] && return
@antlis
antlis / gist-copy.sh
Created April 16, 2026 19:54
Interactive GitHub Gist picker that copies content to clipboard. Uses the GitHub CLI (gh) and fzf to list your gists, preview them, and copy the selected gist’s raw content directly to the clipboard. Supports Linux (xclip) and macOS (pbcopy). Useful for quickly grabbing snippets without opening the browser.
gist-copy() {
gh gist list --limit 100 \
| fzf --preview 'gh gist view {1} --raw' \
| awk '{print $1}' \
| xargs gh gist view --raw \
| xclip -selection clipboard # Linux
# | pbcopy # macOS
}
@antlis
antlis / wtf.sh
Created April 16, 2026 19:52
A small shell utility for interactively switching between Git worktrees using fzf. It displays available worktrees, allows fuzzy selection, and checks out the corresponding branch instantly. Ideal for workflows that rely heavily on git worktree.
wtf() {
local selected
selected=$(wt list | fzf --ansi --header "Select worktree" --header-lines=1)
if [[ -n "$selected" ]]; then
local branch
branch=$(echo "$selected" | awk '{print $2}')
wt switch "$branch"
fi
}
[Desktop Entry]
Version=1.0
Name=Firefox Developer Edition
Comment=Firefox Developer Edition
Exec=/opt/firefox-dev/firefox
# Path=/opt/firefox-dev/firefox
Icon=/opt/firefox-dev/browser/chrome/icons/default/default128.png
Terminal=false
Type=Application
Categories=Browser;Development;
const tree = {
value: 1,
children: [
{
value: 10,
children: [
{
value: 2,
},
],
@antlis
antlis / ga-2019.pug
Created August 16, 2019 09:51
GTAG Script 2019, pug mixin
mixin ga(id)
script(async='', src='https://www.googletagmanager.com/gtag/js?id='+id)
script.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '!{id}')
@antlis
antlis / svg-icon.pug
Created August 15, 2019 10:21
Pug mixin that will output svg icon, in case you use svg sprites
mixin svgIcon(iconId)
i(class="icon icon--"+iconId)
svg.icon__svg
use(xlink:href='#'+iconId)
@antlis
antlis / ga-html5boilerplate.pug
Last active August 21, 2019 03:39
Google analytics pug mixin, HTML5 boilerplate like
mixin ga(id)
//- Pass your ga id, as attribute, eg. +ga('yourid12345')
script.
window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
ga('create', '!{id}', 'auto'); ga('set','transport','beacon'); ga('send', 'pageview')
script(src='https://www.google-analytics.com/analytics.js')