Skip to content

Instantly share code, notes, and snippets.

View sardonyx001's full-sized avatar
🤲
in the java stack trace trenches

jam sardonyx001

🤲
in the java stack trace trenches
View GitHub Profile
@sardonyx001
sardonyx001 / dnsmasq OS X.md
Created March 5, 2026 04:49 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@sardonyx001
sardonyx001 / relocate.md
Created March 3, 2026 04:33
Claude Code session relocate command
description argument-hint allowed-tools
Move this session's conversation history to a new working directory path
<new-path> [--all] [--copy]
Bash(pwd:*), Bash(realpath:*), Bash(echo:*), Bash(ls:*), Bash(find:*), Bash(mkdir:*), Bash(mv:*), Bash(cp:*)

Relocate Claude Code session history to a new working directory.

Arguments: "$ARGUMENTS"

@sardonyx001
sardonyx001 / gopass-get-secret.sh
Created August 22, 2025 04:53
Gopass headlessly return secret
gopass show -o [MY_SECRET] | tr -d '\n'
@sardonyx001
sardonyx001 / git-fuckoff.sh
Created August 14, 2025 11:28
git alias to ignore annoying files without putting them in .gitignore
git config --global alias.fuckoff '!git status -s | awk "{printf \$2\"\\n\"}" >> .git/info/exclude'
@sardonyx001
sardonyx001 / conform.lua
Created November 13, 2024 04:56
Caddyfile formatter for neovim
return {
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
["_"] = { "caddy_fmt" },
},
formatters = {
caddy_fmt = {
@sardonyx001
sardonyx001 / fetch-repo-topics.sh
Created October 9, 2024 02:25
Fetch a github repo's topic tags
#! /usr/bin/env bash
# if you have gh and jq installed
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/OWNER/REPO/topics \
| jq -r '.names[]'
@sardonyx001
sardonyx001 / coffeeware
Last active October 8, 2024 10:39 — forked from q3w3e3/monsterware
/*
* ------------------------------------------------------------
* "THE COFFEEWARE LICENSE" (Revision 03):
* <author> wrote this code. As long as you retain this
* notice, you can do whatever you want with this stuff. If we
* meet someday, and you think this stuff is worth it, you can
* buy me a coffee in return.
* ------------------------------------------------------------
*/
@sardonyx001
sardonyx001 / waifu.sh
Created August 9, 2024 20:21
Grab a random anime girl photo and display it in the terminal
curl -s https://api.waifu.pics/sfw/waifu \
| jq '.url' \
| xargs wget -nv 2>&1 \
| perl -npe 's/.*"([^"]+)".*/$1/' \
| xargs wezterm imgcat
@sardonyx001
sardonyx001 / sed.sh
Last active July 15, 2024 03:18
Sed cheatsheet
# Removes all lines containing `string` from input.txt and prints the result to STDIN
sed '/string/d' input.txt
# Overwrites the file with the modification
sed '/string/d' input.txt > input.txt
# Overrite inplace (Doens't work wth GNU sed, only MacOS & BSD sed)
sed -i '' '/string/d' input.txt
# GNU sed version
sed -i '/string/d' input.txt
@sardonyx001
sardonyx001 / suffix_tree.py
Last active July 14, 2024 16:19
Generate suffix tree of a given string
from graphviz import Digraph
import argparse
class TreeNode:
def __init__(self):
self.children = {}
self.indexes = []