Skip to content

Instantly share code, notes, and snippets.

View omc8db's full-sized avatar

Owen Chiaventone omc8db

View GitHub Profile
@omc8db
omc8db / stategraph.py
Created December 7, 2023 03:48
pyStateGraph
import inspect
from collections import defaultdict
class StateGraph:
"""Dictionary that lets you add keys calculated from other keys
When an entry is updated all dependent values update recursively
Values may be any type valid for use in a standard dictionary.
Keys must be valid names for function arguments.
@omc8db
omc8db / fed2wap.py
Last active July 7, 2023 07:00
@spacenerd — Today at 1:59 PM "Could you make an awk script to print out the lyrics from WAP by only grouping 3 or more letters together at a time when parsing through the federal budget proposal?"
#!/usr/bin/env python3
import sys, re
MIN_MATCH=3
MAX_MATCH=9
# The lyrics of "Wet Ass Pussy" by Cardi B
target=open(sys.argv[1]).read()
# United States House Resolution 2617, Omnibus spending bill for FY2023
reference=open(sys.argv[2]).read().lower()
@omc8db
omc8db / rofi-emoji.sh
Last active April 14, 2024 01:28 — forked from tadly/rofi-emoji.sh
Rofi emoji picker
#!/usr/bin/env bash
#
# Use rofi to pick emoji because that's what this
# century is about apparently...
#
# Requirements:
# rofi, xsel, xdotool, curl
#
# Usage:
# 1. Download all emoji