Skip to content

Instantly share code, notes, and snippets.

@catskull
catskull / midi_clock.ino
Created October 4, 2016 02:47
A simple sketch that sends a midi clock signal
int tempo = 50;
void setup() {
// put your setup code here, to run once:
Serial.begin(31250);
Serial.write(250);
}
void loop() {
// put your main code here, to run repeatedly:
for (int i = 0; i < 10; i++) {
# brew install bash-completion
if [ -f /usr/local/etc/bash_completion ]; then
. /usr/local/etc/bash_completion
fi
# DL git prompt here: https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
source ~/.git-prompt.sh
export PS1='\w\[\e[0;33m\]$(__git_ps1 " (%s)")\[\e[m\]\$ '
#include <Ultrasonic.h>
Ultrasonic ultrasonic(5, 4);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
@catskull
catskull / Brewfile
Created November 7, 2018 03:56
Brewfile
tap "armmbed/formulae"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "osx-cross/avr"
tap "somaticlabs/gnu-arm-toolchain"
brew "bash-completion"
brew "git"
brew "libusb"
brew "python"
#include <avr/pgmspace.h>
const unsigned char usa [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
0x60, 0xE0, 0xE0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 0xE0, 0x60, 0x60, 0x60,
0x60, 0x60, 0x60, 0xE0, 0xE0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80,
0x80, 0xE0, 0xE0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xE0, 0xE0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00,
0x00, 0xF8, 0xF8, 0xF8, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xE0, 0xF8, 0xF8, 0x18, 0x18, 0x18,
@catskull
catskull / init.lua
Last active August 3, 2021 19:02
Hammerspoon config
-- https://github.com/catskull/MusicMenuDisplay.spoon
hs.loadSpoon("MusicMenuDisplay")
-- https://github.com/catskull/CPUTempMenuDisplay.spoon
hs.loadSpoon("CPUTempMenuDisplay")
hs.window.animationDuration = 0
local workMonitor = "LG Ultra HD"
-- Super specific window layout for my 43" 4k display
{
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"window.zoomLevel": 2,
"editor.fontSize": 14,
"editor.fontLigatures": true,
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.minimap.enabled": false,
"editor.tabSize": 2,
avrdude -p atmega328p -c usbtiny -U lock:w:0x2f:m -U hfuse:w:0xda:m -U lfuse:w:0xFf:m -U efuse:w:0x07:m
SEGA MEGA DRIVE PORT 2 PIN 1 <--- ARDUINO ANALOG PIN 0 = teensy 0
SEGA MEGA DRIVE PORT 2 PIN 2 <--- ARDUINO ANALOG PIN 1 = teensy 1
SEGA MEGA DRIVE PORT 2 PIN 3 <--- ARDUINO ANALOG PIN 2 = teensy 2
SEGA MEGA DRIVE PORT 2 PIN 4 <--- ARDUINO ANALOG PIN 3 = teensy 3
SEGA MEGA DRIVE PORT 2 PIN 5 ---> ARDUINO 5V = teensy NA
SEGA MEGA DRIVE PORT 2 PIN 6 <--- ARDUINO DIGITAL PIN 4 = teensy 6 = nb
SEGA MEGA DRIVE PORT 2 PIN 7 <--- ARDUINO DIGITAL PIN 2 = teensy 5 = wr
SEGA MEGA DRIVE PORT 2 PIN 8 <--> ARDUINO 0V = teensy ground
SEGA MEGA DRIVE PORT 2 PIN 9 <--- ARDUINO DIGITAL PIN 3 = teensy 4 = ad
# mostly taken from this stack overflow post: https://stackoverflow.com/a/39212997
class Array
def difference(other)
h = other.each_with_object(Hash.new(0)) { |e,h| h[e] += 1 }
reject { |e| h[e] > 0 && h[e] -= 1 }
end
end
def scrabble(letters)
f = File.open('/usr/share/dict/words')