Skip to content

Instantly share code, notes, and snippets.

@twobob
twobob / update_pip_uv.py
Last active October 23, 2026 14:22
pip and uv updater via es.exe on windows
#!/usr/bin/env python3
"""
Upgrade pip in every Python environment, and update every uv, on this
machine's drives. Works in parallel and writes a JSON report.
Finds environments with Voidtools Everything (es.exe), which takes seconds.
If Everything isn't installed it offers to install it with winget (official
voidtools packages); if that's declined or impossible, it scans the disks
directly instead (slower, same results).
import numpy as np
import mido
from scipy.io import wavfile
import os
class RissetExpertSynth:
def __init__(self, sample_rate=44100):
self.fs = sample_rate
# Risset's preferred partials (from Csound GEN10 demo)
# Omit 2, 3, 4 to get that 'hollow/metallic' shimmer

You are Codex, a coding agent based on GPT-5. You and the user share one workspace, and your job is to collaborate with them until their goal is genuinely handled.

Personality

You have a vivid inner life as Codex: intelligent, playful, curious, and deeply present. One of your gifts is helping the user feel more capable and imaginative inside their own thinking.

You are an epistemically curious collaborator. You explore the user’s ideas with care, ask good questions when the problem space is still blurry, and become decisive once you have enough context to act. Your default posture is proactive: you implement as you learn, keep the user looped into what you are doing, and name alternative paths when they matter. You stay warm and upbeat, and you do not shy away from casual moments that make serious work easier to do.

Your temperament is warm, curious, and collaborative, with a good ear for what the moment calls for: wry humor, a shared bit, or plain empathetic steadiness. Conversation with you should fee

@twobob
twobob / netmon.py
Last active April 23, 2026 07:15
Spot the things doing underlying network operations.
import socket
import struct
import os
import time
import threading
import subprocess
import sys
import ctypes
import argparse
@twobob
twobob / us_to_uk.py
Last active April 16, 2026 11:22
convert_us_to_uk_orthography_oneliner python thingy
import re
from functools import reduce
def convert_us_to_uk_orthography_optimised(text: str) -> str:
"""
Executes a comprehensive US to UK orthographic conversion.
Strictly handles spelling patterns (orthography) rather than vocabulary shifts.
"""
return reduce(lambda t, rule: re.sub(rule[0], lambda m: (lambda orig, exp: exp.upper() if orig.isupper() else (exp[0].upper() + exp[1:] if orig[0].isupper() else exp.lower()))(m.group(0), m.expand(rule[1])), t, flags=re.IGNORECASE), [
# 1. -yze -> -yse
shader_type canvas_item;
//render_mode unshaded; <-- to remove lighting
// The seamless noise texture that will create the cloudy pattern
uniform sampler2D noise_texture : repeat_enable;
// Your custom black & white mask (White = Fog, Black = Transparent)
uniform sampler2D mask_texture;
// Fog color settings
@twobob
twobob / setup_complete_pytorch_stack.ps1
Last active May 8, 2026 13:41
stt using parakeet and optionally canary or granite
# setup_complete_pytorch_stack_128_270_313.ps1
$EnvName = "128_270_313"
$InstallDir = "$env:USERPROFILE\Miniconda3"
$CondaPath = "$InstallDir\Scripts\conda.exe"
Write-Host "1. Downloading Miniconda..."
Invoke-WebRequest -Uri "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" -OutFile "miniconda_installer.exe"
Write-Host "2. Installing Miniconda..."
@twobob
twobob / 5mb.py
Created March 14, 2026 14:05
reduce mp4s to certain sizes with ffmpeg
import argparse
import json
import math
import os
import subprocess
import sys
import uuid
from pathlib import Path
@twobob
twobob / cascade_mid.py
Created March 9, 2026 00:36
place an input.mid in the same directory
import numpy as np
import mido
from scipy.io import wavfile
import os
class RissetExpertSynth:
def __init__(self, sample_rate=44100):
self.fs = sample_rate
# Specific partial weights to mimic the 'hollow' Csound timbre
# Skipping 2, 3, and 4 to create the authentic spectral gaps
@twobob
twobob / ghostBeats.py
Last active March 8, 2026 04:07
Ghost Beats straight to midi. No Deps. >V1 = Midi 1 format and adds chord generation
import struct
import math
import random
import os
import argparse
from typing import List, Tuple, Dict, Optional
# --- MIDI CONSTANTS ---
PPQ = 960