Skip to content

Instantly share code, notes, and snippets.

@cartok
cartok / md-to.zsh
Last active February 5, 2026 22:12
[cli] Generate .pdf or .html from .md
#!/usr/bin/env zsh
function md-to-pdf() {
-md-to "$1" pdf
}
function md-to-html() {
-md-to "$1" html
}
@cartok
cartok / adb-wireless.yml
Last active January 7, 2026 10:26
[cli] Connect Android for development wirelessly
version: "3"
set: [ pipefail ]
tasks:
connect-smartphone:
interactive: true
silent: true
preconditions:
- command -v sudo
- command -v gum
@cartok
cartok / reset.css
Last active March 19, 2026 18:12
[css] reset rulez
:root {
font-family: sans-serif;
line-height: 1;
font-weight: 400;
overflow-wrap: break-word;
word-break: break-word;
font-synthesis: none;
text-rendering: geometricPrecision;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@cartok
cartok / rgo.sh
Last active June 1, 2026 00:51
[cli] rgo - rip grep open
function rgo() {
local input="rg --column --line-number --no-heading --color=always --smart-case --"
: | fzf --ansi --disabled --query "${*:-}" \
--bind "start:reload:$input {q}" \
--bind "change:reload:sleep 0.1; $input {q} || true" \
--delimiter : \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \
--bind "enter:become($VISUAL {1})"
}
@cartok
cartok / kill-port.sh
Last active February 14, 2026 22:35
[cli] kill-port
function kill-port() {
ss --numeric --tcp --listening --processes --resolve --no-header --no-queues --oneline \
| grep "pid=" \
| sd '^\w+ +(?P<HOST>[^:]+):(?P<PORT>\d+) [^"]+"(?P<NAME>[^"]+)",pid=(?P<PID>\d+).*\n?' '$NAME: $HOST:$PORT [$PID]\n' \
| fzf --prompt="Select to kill: " \
| sd '[^\[]+\[(\d+)\]' '$1 ' \
| xargs --no-run-if-empty kill -15
}
// ==UserScript==
// @name JIRA Board Epic Filter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Helper functions to only see one epic at a time on the board
// @author cartok
// @match https://*.atlassian.net/*/boards/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net
// @grant none
// @license MIT