Skip to content

Instantly share code, notes, and snippets.

View routevegetable's full-sized avatar

Lee Marshall routevegetable

  • West Oakland, CA
View GitHub Profile
@routevegetable
routevegetable / tempo.h
Created June 10, 2025 07:07
Primitives for deterministic sequencing of wavy things
#pragma once
#include <stdint.h>
/**
* msecs
*/
typedef uint32_t when_t;
/**
use std::{process::Output, time};
use timebase::{Event, Frame};
use tinyaudio::prelude::*;
mod timebase;
#[derive(Copy, Clone)]
struct Note {
use std::{process::Output, time};
use timebase::{Event, Frame};
use tinyaudio::prelude::*;
mod timebase;
const MSEC: i32 = 10;
use fastrand;
#[derive(Debug, Copy, Clone)]
pub enum TimebaseMode {
OneShot,
Repeat
}
#[derive(Debug, Copy, Clone)]
pub struct Timebase {
DISPLAY= socat TCP-LISTEN:1337,crlf,fork exec:"mplayer -vo caca -quiet /home/lmarshall/Downloads/Rick_Astley_-_Never_Gonna_Give_You_Up_dQw4w9WgXcQ.mp4",pty
template<class T>
struct PolyBox {
typedef std::unique_ptr<T> Ptr;
/* Regular constructor */
PolyBox(Ptr&& p): ptr(std::move(p)) {}
/* Copy */
PolyBox(const PolyBox& t) : ptr(Ptr(t.ptr->clone())) {}
PolyBox& operator=(const PolyBox& t) {
def ingest(s):
counts = {}
for c in s:
if not c in counts:
counts[c] = 0
counts[c] += 1
return counts
import math
@routevegetable
routevegetable / origin.sh
Last active July 12, 2022 17:52
ssh things
SOCK_LINK=/tmp/ssh_auth_sock_link
start_ssh_agent() {
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
ln -vsnf $SSH_AUTH_SOCK $SOCK_LINK
}
if [[ $- == *i* ]] && ! [[ -e $SOCK_LINK ]]; then
# Agent socket link doesn't exist - assume agent isn't running
start_ssh_agent
fi
months = [
("January", 3),
("February", 0),
("March", 3),
("April", 2),
("May", 3),
("June", 2),
("July", 3),
("August", 3),
("September", 2),
@routevegetable
routevegetable / xga.spin
Last active March 18, 2022 17:38
Propeller SPIN XGA driver
'VGA Driver by Lee Marshall
CON
_clkmode = XINPUT + PLL16X
_xinfreq = 4_000_000
VAR
long bitmapbase[1536]
byte cog