Skip to content

Instantly share code, notes, and snippets.

View jac18281828's full-sized avatar
🦌

John Cairns jac18281828

🦌
View GitHub Profile
@jac18281828
jac18281828 / README.md
Last active January 20, 2026 18:27
Audiobook generator - text2mp3_piper.py

text2mp3 (Piper TTS)

A cross-platform, fully offline text-to-MP3 pipeline built on Piper TTS.
Designed for long-form reading (ebooks, essays, Project Gutenberg texts) with natural pacing, clean chunk boundaries, and intentional pauses that sound like real speech rather than stitched audio.

This tool:

  • Reads .txt or .pdf (optional page ranges)
  • Cleans and normalizes text for speech
  • Chunks intelligently (paragraph-aware, sentence-safe)
  • Inserts natural pauses between chunks and paragraphs
@jac18281828
jac18281828 / confetti.py
Last active January 16, 2026 22:59
python rendering sample codes
import math
import random
import time
from collections import deque
import pyglet
from pyglet import gl
# -------------------- CONFIG --------------------
PARTICLES = 20_000
@jac18281828
jac18281828 / 75easy.mms
Last active January 2, 2026 02:21
75 Hard Time Tracker in MMIX
LOC #1000
START_TIME IS 1767310000
DAY IS 86400
Main
TRAP 0, Time, 0
SETI $1, START_TIME
SETI $3, DAY
MULI $3, $3, 3 % buffer for 3 days
@jac18281828
jac18281828 / gcdeuclid.mms
Created January 1, 2026 22:09
GCD Euclid using Subtraction only in MMIX
LOC #1000
Tmp IS $252
% Entry point
Main
SETI $0, 48
SETI $1, 18
PUSHJ $0, GcdEuclid
BN $1, Error
@jac18281828
jac18281828 / advent11.mms
Last active December 28, 2025 01:42
Advent of Code 2025 Day 1 Example MMIX
DIAL_INCREMENTS IS 100
LOC #100
% Entry point
GREG @
InputPtr GREG 0 % global register for input pointer
Main LDA InputPtr,MyInput % initialize pointer
SETI $10,50 % dial setting - current dial pointer (starts at 50)
SETI $11,0 % count number of operations handled
@jac18281828
jac18281828 / Dockerfile
Created December 27, 2025 20:39
Dockerfile for mmixware
# Phase 1: Build mmixware
FROM debian:stable-slim AS mmixware-builder
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
ca-certificates \
build-essential \
texlive-binaries texlive-base \
&& rm -rf /var/lib/apt/lists/*
@jac18281828
jac18281828 / powerOf2.mms
Last active December 27, 2025 01:29
PowerOf2 MMIX
LOC #100
% Entry point
Main SETI $1,20
PUSHJ $0,IntegerPowerOfTwo % compute 2^$1
JMP Done
% ----------------------------------------------------
% compute the power of 2 to the n where n is in $1
% result is returned in $0
@jac18281828
jac18281828 / big_fib.mms
Last active December 27, 2025 00:07
Compute big fibonacci in MMIX - big_fib is an easy to understand version big_fib_opt is a more optimal less readable version
% ----------------------------------------------------
% Fibonacci (Big Integer) - bounded arbitrary precision
% BigInt = MAXLIMBS limbs, each limb is 64-bit unsigned
% Little-endian limbs: limb[0] is least significant
%
% Computes fib(n) where n is in $1
% Result is in BufB
% ----------------------------------------------------
% ----------------------------------------------------
@jac18281828
jac18281828 / AI_CONTRIBUTING.md
Created December 17, 2025 22:28
Ai coding guidelines for rust

AI Coding Guidelines (Rust)

These guidelines apply to all AI-assisted code changes in this repository.

Workflow

  • Read the full contents of any file you plan to change, plus directly related modules.
  • Summarize current behavior and invariants before proposing edits.
  • Propose a minimal patch plan (files + rationale) before modifying code.

Rust Style & Design

@jac18281828
jac18281828 / parquet_schema.py
Created November 25, 2025 17:26
dump a parquet file and try to interpret its schema
#!/usr/bin/env python3
"""
parquet_schema.py — Quick column (schema) lister for Parquet files or partitioned folders.
Usage:
python parquet_schema.py /path/to/file.parquet
python parquet_schema.py /path/to/folder # infers dataset schema across files
python parquet_schema.py /path --raw # print raw Arrow schema
python parquet_schema.py /path --json # JSON output