Skip to content

Instantly share code, notes, and snippets.

View jac18281828's full-sized avatar
🦌

John Cairns jac18281828

🦌
View GitHub Profile
% =====================================================================
% test_atan.mms -- Test harness for the Atan library.
% =====================================================================
%
% Build: mmixal test_atan.mms
% Run: mmix test_atan
%
% Output looks like:
%
% atan tests:

Solitare of Olympus — Code Review

Bugs / Correctness Issues

1. IAM ARN double colon (false alarm)

deploy-static-site.yml:31

role-to-assume: arn:aws:iam::504242000181:role/GithubDeployCI

Standard ARN format for IAM is arn:aws:iam:::role/... with no region (empty field), so the double colon is correct. Disregard.

@jac18281828
jac18281828 / AGENTS.md
Last active April 20, 2026 15:49
AI_CONTRIBUTING.md - rules for agents to modify my code

AI Contributing Requirements

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

Workflow

  1. Scan every file you plan to change and directly related modules.
  2. Summarize current behavior and invariants.
  3. Propose a minimal patch plan (diff and rationale).
  4. Obtain user approval before editing code.
  5. Affirm all Completion Gates are met.
@jac18281828
jac18281828 / README.md
Last active March 9, 2026 14: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