Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bun
import { $ } from "bun";
const prompt =
"Generate a concise Git commit message for the staged diff. Plain text only. Imperative subject; body only if useful.";
async function main(): Promise<0 | 1> {
await $`git add -A -- .`;
#!/usr/bin/env bun
/**
* Downloads media audio with yt-dlp, transcribes it with FluidAudio CLI, and
* prints the transcript to stdout.
*
* Requirements:
* - yt-dlp: https://github.com/yt-dlp/yt-dlp/
* - FluidAudio CLI: https://github.com/FluidInference/FluidAudio/blob/main/Documentation/CLI.md
* - Cookies under ~/.yt-dlp/ when transcribing auth-protected sites
@meoyawn
meoyawn / SKILL.md
Created June 21, 2026 11:02
let agents read twitter
name twitter
description Use when encountering https://x.com/<path> URLs

Instead of https://x.com/<path>, fetch:

curl -L 'https://nitter.tiekoetter.com/<path>'
@meoyawn
meoyawn / SKILL.md
Last active May 3, 2026 08:59
yaml-kanban
name yaml-kanban
description Use when editing kanban/TODO.yaml or kanban/DONE.yaml

YAML Kanban

Trigger skill for any kanban/TODO.yaml or kanban/DONE.yaml. Never write files for this skill other than kanban/TODO.yaml and kanban/DONE.yaml.

#!/usr/bin/env bun
const timeoutMs = 5_000;
const sources = ["https://ipv4.icanhazip.com", "https://2ip.ru"] as const;
const results = await Promise.all(
sources.map((url) =>
fetch(url, {
headers: { "User-Agent": "curl/8.0.0" },
@meoyawn
meoyawn / jsonlogic.ts
Created November 11, 2024 07:48
minimal implementation of jsonlogic.com just in case something isn't working
type Comparable = number | string | Date | boolean | bigint
type CompareOp = "<" | ">" | "<=" | ">=" | "===" | "!=="
const compareFns: Readonly<
Record<CompareOp, <T extends Comparable>(a: T, b: T) => boolean>
> = {
"<": (a, b) => a < b,
"<=": (a, b) => a <= b,
">": (a, b) => a > b,
@meoyawn
meoyawn / xml.kt
Last active February 29, 2024 16:17
fast XML DSL in 70 lines
package lib.xml
import org.apache.commons.text.StringEscapeUtils
fun StringBuilder.put(attrs: Array<out Pair<String, Any?>>) {
for ((k, v) in attrs) {
if (v == null) continue
append(' ')
append(k)
const productContainer = document.querySelector('div[data-qa-locator="general-products"]');
const sortedEls = Array.from(productContainer.children)
.flatMap(product => {
const salesInfo = product.querySelector('._1cEkb');
if (!salesInfo) return [];
const salesText = salesInfo.innerText;
const [soldStr] = salesText.split(' ')
const salesCount = parseInt(soldStr.replace(",", ""));
@meoyawn
meoyawn / Makefile
Created April 8, 2022 14:12
generate TS client
DIR:=gen/
openapi:
rm -rf $(DIR)
openapi-generator generate -g typescript-fetch -i http://localhost:8080/openapi.json -o $(DIR) --remove-operation-id-prefix --additional-properties=typescriptThreePlus=true,modelPropertyNaming=original,nullSafeAdditionalProps=true,enumPropertyNaming=original,supportsES6=true,useSingleRequestParameter=false
grep -rl "? undefined" $(DIR) | xargs sed -i '' 's/? undefined/? null/g'
@meoyawn
meoyawn / pyproject.toml
Created July 30, 2020 13:02
gpt-2 dependencies
[tool.poetry]
version = "1.0.0"
name = "gpt-2"
description = ""
authors = []
[tool.poetry.dependencies]
fire = "^0.1.3"
regex = "2017.4.5"
requests = "2.21.0"