Skip to content

Instantly share code, notes, and snippets.

View omc8db's full-sized avatar

Owen Chiaventone omc8db

View GitHub Profile
@omc8db
omc8db / markov.py
Last active September 5, 2024 15:00
Simple markov chain text generator in python, bash script friendly. We have copilot at home.
#!/usr/bin/env python3
import argparse
import random
import sys
from collections import defaultdict
parser = argparse.ArgumentParser()
parser.add_argument("input", nargs="*", default="-", help="source text")
parser.add_argument("-n", "--window", type=int, default=3, help="windows size")
parser.add_argument(
@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 November 30, 2024 19:57 — 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