Skip to content

Instantly share code, notes, and snippets.

View mbutler's full-sized avatar
🇦🇶
Exploring

Matthew Butler mbutler

🇦🇶
Exploring
View GitHub Profile
@mbutler
mbutler / import_4e.py
Created July 7, 2025 15:37
import 4e compendium sql files. Holy hell what a mess
import os
import re
import sqlparse
import pymysql
import sqlglot
from pathlib import Path
# CONFIG
DB_NAME = '4e_compendium'
DB_USER = 'mbutler'
@mbutler
mbutler / html_to_markdown.py
Last active July 7, 2025 16:19
convert html to markdown
import pymysql
import re
from bs4 import BeautifulSoup, XMLParsedAsHTMLWarning
import html2text
import warnings
from pathlib import Path
# Suppress BeautifulSoup XMLParsedAsHTMLWarning
warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning)
@mbutler
mbutler / cubswin.md
Created June 25, 2025 19:09
Amazing simulated game

At-Bat Result Inning 1 - Top William Contreras: Flyout to CF (Outs: 1, Score: Away 0 – Home 0, Bases: Empty) Rhys Hoskins: K (Outs: 2, Score: Away 0 – Home 0, Bases: Empty) Brice Turang*: Groundout to 1B (Outs: 3, Score: Away 0 – Home 0, Bases: Empty) Inning 1 - Bottom Carson Kelly: Flyout to LF (Outs: 1, Score: Away 0 – Home 0, Bases: Empty) Michael Busch*: BB (Outs: 1, Score: Away 0 – Home 0, Bases: 1B) Nico Hoerner: Groundout to 2B (Outs: 2, Score: Away 0 – Home 0, Bases: 2B) Dansby Swanson: 1B (Outs: 2, Score: Away 0 – Home 0, Bases: 1B, 3B)

@mbutler
mbutler / dogwhistle.py
Created June 6, 2025 21:03
UAP Dog Whistle
# https://x.com/jasonwilde108/status/1910816547070685522
import numpy as np
from scipy.signal import chirp
from pydub import AudioSegment
from pydub.generators import Sine, WhiteNoise
SAMPLE_RATE = 44100 # CD quality
DURATION = 60 # seconds of output
VOLUME = -20 # dBFS
@mbutler
mbutler / transcribe-audio-whisper.py
Last active June 3, 2025 19:28
Batch transcribe audio and video files using OpenAI Whisper
import os
import math
import subprocess
import openai
import pysrt
from datetime import timedelta
API_KEY = "api-key"
INPUT_DIR = "input_media"
CHUNK_DIR = "audio_chunks"
@mbutler
mbutler / numogram.md
Last active May 28, 2025 19:04
Mermaid diagram of the Numogram
graph TD
    %% Zones (Nodes 0-9): Represent the 10 cosmic nodes of the Numogram
    Z0[0]
    Z1[1]
    Z2[2]
    Z3[3]
    Z4[4]
    Z5[5]
    Z6[6]
@mbutler
mbutler / dracula.md
Last active February 28, 2025 20:59
Fury of Dracula 2nd ed.

🦇 Fury of Dracula Cheat Sheet

📌 Turn Order (p.1)

  1. Dracula's Turn
    • Timekeeping: Advance the Day/Night track (p.1).
    • Movement: Play a Location or Power card (p.3).
    • Action Phase:
      • If Dracula is in a city with a HunterCombat begins (p.4).
      • Otherwise, place an Encounter on the new location (p.3).
  • Mature Encounters (p.5).
@mbutler
mbutler / scoundrel.py
Created February 23, 2025 00:17
debug the solitaire game Scoundrel to prove how hard if not impossible it is
import random
def simulate_scoundrel(debug=False):
deck = []
for value in range(2, 11):
deck.append((value, 'monster'))
deck.append((value, 'monster'))
deck.append((value, 'weapon'))
deck.append((value, 'potion'))
for value in [11, 12, 13, 14]:
@mbutler
mbutler / character_template.md
Last active February 24, 2025 06:56
Log scale for game measurements

Below are three simple templates for Normal Human, Pro Athlete, Elite Human, and Superhuman, using the recalibrated Layer 0 foundational attributes from your system. Each template lists the levels, corresponding numerical values, and point totals. The Normal Human is our baseline from the previous step (19 points). The Pro Athlete builds on that with 2-3 attributes boosted to professional athlete levels (mid-to-high human range). The Elite Human pushes 1-2 attributes to the maximum human potential (Level 10). The Superhuman exceeds human limits, entering comic book territory with higher levels across the board.


1. Normal Human

  • Description: An average adult, as established earlier, with ~18-20 points.
  • Total Points: 19
Attribute Level Value Points
@mbutler
mbutler / orbs.js
Last active February 17, 2025 18:59
Attack and Cast Sequence Game
const iterations = 1000000 // number of simulated sequences. 1000000 is the right number
const sequenceLength = 7 // number of turns in each sequence
const orbCapacity = 7 // maximum number of orbs that can be held for each effect type
// types of orbs that can be produced or consumed
const effectTypes = [
'Piercing',
'Slashing',
'Crushing',
'Cleaving',
'Force',