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 / analyze_apache.py
Created August 27, 2025 14:10
Analyze Apache logs to generate usage stats
#!/usr/bin/env python3
"""
Analyze Apache *combined* access logs and export CSVs.
Outputs:
00_summary.csv # headline metrics
10_pages.csv # per-page counts (querystrings stripped, static excluded)
20_daily_requests.csv # all requests per day
21_daily_pageviews.csv # "pageviews" per day (static excluded)
30_status_codes.csv # status code breakdown
const slides = [
{
title: "Remmelin",
subtitle: "Catoptrum microcosmicum (1661)",
description: "Explore a page from this medical flap book by Johann Remmelin.\n<span style=\"font-size: 0.9em; opacity: 0.8; display:block; margin-top:6px;\">FOLIO QM21 .R45 1661, John Martin Rare Book Room.</span>",
media: [
{ type: "video", src: "assets/videos/remmelin/remmelin_man.mp4", loop: true },
{ type: "video", src: "assets/videos/remmelin/remmelin_plate_clouds.mp4", loop: true },
{ type: "video", src: "assets/videos/remmelin/remmelin_plate_eye.mp4", loop: true },
{ type: "video", src: "assets/videos/remmelin/remmelin_plate_man.mp4", loop: true },
@mbutler
mbutler / dnd4e.css
Created July 14, 2025 21:36
4e styling
/*
* D&D 4e Style Sheet - Universal 4e Block Styling
* Combines and adapts styles from the project's CSS library
* For use with any D&D 4e code block: powers, monsters, items, etc.
*/
:root {
--font-primary: 'DragonBodySans', Arial, sans-serif;
--font-secondary: 'DragonBodySerif', Georgia, serif;
--background-atwill: #619769;
@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).