This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""JACK client that inverts pedal mapping.""" | |
import jack | |
import struct | |
import threading | |
client = jack.Client("invert pedal") | |
port_input = client.midi_inports.register("input") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# convert quicktime music movie into midi file | |
from __future__ import annotations | |
from collections import namedtuple | |
from abc import ABC | |
import itertools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# extract the data and resource forks from a mac binary 2 file | |
import sys | |
import struct | |
def unpack(stream, fmt): | |
size = struct.calcsize(fmt) | |
buf = stream.read(size) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
# assignment #1: create a tokenizer that can read basic variables, operators, numbers, and parenthesis | |
# assignment #2: set up node structures for parsing | |
from dataclasses import dataclass | |
import io | |
import re | |
@dataclass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
# create a tokenizer that can read basic variables, operators, numbers, and parenthesis | |
from dataclasses import dataclass | |
import io | |
import re | |
@dataclass | |
class Token: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#define STB_IMAGE_WRITE_IMPLEMENTATION | |
#include "stb_image_write.h" | |
#define COLOR 5 | |
#define OFFSET (256*128) | |
#define WIDTH 256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import numpy as np | |
import math | |
import sys | |
speed_of_sound = 34300 # centimeters/second | |
rate = 24000 # samples/second | |
# seconds to render |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# simple script to help determine rankings by comparing combinations | |
import sys | |
from itertools import combinations | |
with open(sys.argv[1]) as f: | |
items = list(line.strip() for line in f.readlines()) | |
scores = {item: 0 for item in items} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# read in a text file, split it into paragraphs that fit under 2000 characters, add a invisible separator to the end of each except the last, and copy each sequentially and interactively to the clipboard | |
import pyperclip | |
import sys | |
if __name__ == '__main__': | |
if len(sys.argv) < 2: | |
print('plese specify tha name o th file as argument to this progrm 2 copythanxx') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# plays hourly animal crossing wild world music in the background! | |
# uses audacious to play 2sf rips | |
# thus it depends on the 2sf music files and audacious | |
# place the .mini2sf files in the following directory and name the hourly music files with this format: "%H.mini2sf", e.g. "00.mini2sf" (midnight), "04.mini2sf" (4 am), "10.mini2sf" (10 am), "12.mini2sf" (noon), "13.mini2sf" (1 pm), "23.mini2sf" (11 pm), etc. | |
MUSIC_DIR=~/hourly # set to the directory containing the 2sf files |
NewerOlder