Skip to content

Instantly share code, notes, and snippets.

View scruss's full-sized avatar
💭
Will never accept Copilot-generated issues and PRs, Also: 🦆

Stewart Russell scruss

💭
Will never accept Copilot-generated issues and PRs, Also: 🦆
View GitHub Profile
@shadwork
shadwork / vsfparser.py
Last active July 10, 2025 22:46
Python script to open vice 64 emulator snapshot with vsf extension, based on v2 specification
import sys
import os
import struct
ram_dump = bytearray()
def dword(byte_array):
return struct.unpack('I',byte_array)[0]
def word(byte_array):
@shadwork
shadwork / sinclair_basic2ascii.py
Created May 14, 2024 10:41
Python script to decompile ZX-Spectrum BASIC to text using tzxtools library
#!/usr/bin/env python3
import argparse
import sys
from tzxlib.convert import convertToBasic
def main():
parser = argparse.ArgumentParser(description='Convert Sinclair Basic code representation into Text')
parser.add_argument('file',
@benagricola
benagricola / test.py
Last active January 1, 2025 05:11
Using MicroPython's new pure-python USB driver to send audio data to the host.
import array
import math
import time
import os
import usb.device
from uac2 import AudioInterface
print("Okay, configuring the audio interface now...")
@Corteil
Corteil / keybow.py
Last active October 4, 2022 19:53
Modified keybow.py file for KMK firmware
"""
KMK keyboard for Pimoroni Keybow.
WARNING: This doesn't currently function correctly on the Raspberry Pi Zero,
some of the keys are stuck in the 'pressed' position. There's either a bug in
the keypad implementation on the rpi0, or the pin numbers don't match the pins
in linux.
This is a 4x3 macro pad designed to fit the rpi's GPIO connector. Each key is
attached to a single GPIO and has an APA102 LED mounted underneath it.
@tef
tef / photo.md
Last active January 19, 2024 03:24
@AkBKukU
AkBKukU / dectalk.py
Created September 10, 2022 18:32
Python script for writing to DECtalk devices with resets for commands
#!/usr/bin/python3
import serial
import sys
# DECtalk output over serial with command resetting
ser = serial.Serial('/dev/ttyUSB0',9600,timeout=1) # open serial port with 9600 8N1 defaults
print(ser.name) # check which port was really used
for line in sys.stdin:
@foone
foone / chirp font urls.txt
Last active November 7, 2023 03:54
Filter for the new twitter font
https://abs.twimg.com/fonts/chirp-regular-web.woff
https://abs.twimg.com/fonts/chirp-bold-web.woff
https://abs.twimg.com/fonts/chirp-heavy-web.woff
https://abs.twimg.com/fonts/chirp-medium-web.woff
# If you, like me, have all of your various source-code-like projects in ~/src/
# this is how to give yourself per-project shell history.
#
# I wish I'd done this years ago.
#
# First, in your .bashrc file, you redefine the cd, pushd and popd builtins to be "do the builtin bit,
# then do one other thing (set_src_history.sh, below) like so:
cd () {
@fxprime
fxprime / KY_013_temperature_sensor.ino
Created October 26, 2019 09:35
Temperature sensor module KY-013
int ThermistorPin = A0;
int Vo;
float R1 = 10000; // value of R1 on board
float logR2, R2, T;
float c1 = 0.001129148, c2 = 0.000234125, c3 = 0.0000000876741; //steinhart-hart coeficients for thermistor
void setup() {
Serial.begin(9600);
}
@nevillepark
nevillepark / README.md
Last active July 18, 2025 11:43
CBC radio stream URLs

CBC Radio Stream URLs

Using these URLs, you can listen to CBC radio streams with applications like VLC or Transistor. The files are M3U playlists, so you can use them as-is, edit them to suit your tastes, or use individual URLs.

This playlist contains the .m3u8 URLs from the CBC Listen website, which uses the HLS (HTTP Live Streaming) protocol. The audio stream is broken up into multiple tiny files, which are then fed into the .m3u8 playlist file that delivers them to your computer in the right order. This should work with modern media players.

This legacy playlist uses good old-fashioned MP3 streams found on PublicRadioFan.com. It will work with older programs like Winamp that don't support HLS. I don't know how lo