Skip to content

Instantly share code, notes, and snippets.

@cowboy
cowboy / cowboy-akai-force-rec-pedal.ino
Last active Sep 20, 2021
Akai Force Rec Pedal (USB MIDI) - for Teensy LC
View cowboy-akai-force-rec-pedal.ino
// ===============================================================
// Akai Force Rec Pedal (USB MIDI) - for Teensy LC
// "Cowboy" Ben Alman, 2021
// https://gist.github.com/cowboy/5ad43d0d369c79b6d6538f076698e17a
// ===============================================================
// Why does this exist?
//
// I designed this to circumvent an issue with the Akai Force where receiving
// an MMC Rec message signals that the loop should end at the end of the
@cowboy
cowboy / delayed-mmc-rec.ino
Last active Sep 15, 2021
USB MIDI Delayed MMC Rec (Teensy LC)
View delayed-mmc-rec.ino
// =======================================================
// USB MIDI Delayed MMC Rec - for Teensy LC
// "Cowboy" Ben Alman, 2021
// =======================================================
// What does it do?
//
// This USB MIDI device toggles recording via MMC Rec message, but instead of
// sending the MMC Rec message immediately, it sends the message at the end of
// the current measure.
@cowboy
cowboy / border-filter.hlsl
Last active Sep 7, 2021
Draw a border around a source - For use as a filter with StreamFX in OBS Studio
View border-filter.hlsl
// ===============================================================
// Draw a border around a source
// For use as a filter with StreamFX in OBS Studio
// ===============================================================
// "Cowboy" Ben Alman - 2021
// https://gist.github.com/cowboy/9b33aed126b78f60ca8c126567625fc9
// ===============================================================
// See https://github.com/Xaymar/obs-StreamFX/wiki/Source-Filter-Transition-Shader
uniform float4x4 ViewProj<
@cowboy
cowboy / starship.toml
Created May 19, 2021
My current starship config
View starship.toml
[time]
disabled = false
[status]
disabled = false
map_symbol = true
symbol = ""
not_executable_symbol = ""
not_found_symbol = ""
sigint_symbol = ""
@cowboy
cowboy / midi-merge.c
Created Oct 20, 2020
MIDI Merge for ATmega4809 (Curiosity Nano)
View midi-merge.c
/*
* MIDI Merge for ATmega4809
* Copyright (c) 2020 Benjamin Alman
* MIT License
*/
#include <MIDI.h>
MIDI_CREATE_INSTANCE(HardwareSerial, Serial, midi_1);
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, midi_2);
@cowboy
cowboy / .gitignore
Created Sep 30, 2020
kicad gitignore
View .gitignore
# Adapted from:
# https://github.com/github/gitignore/blob/master/KiCad.gitignore
# For PCBs designed using KiCad: http://www.kicad-pcb.org/
# Format documentation: http://kicad-pcb.org/help/file-formats/
# Temporary files
*.000
*.bak
*.bck
@cowboy
cowboy / bom.ini
Last active Sep 30, 2020
generate boms: combine 1 or more KiBoM generated csv files with an id column name like "Digikey" (where a digikey part number is stored) and output IMO a much better csv file (note: do NOT number rows or group fields)
View bom.ini
; https://github.com/SchrodingersGat/KiBoM
;
[BOM_OPTIONS]
; General BoM options here
; If 'ignore_dnf' option is set to 1, rows that are not to be fitted on the PCB will not be written to the BoM file
ignore_dnf = 1
; If 'html_generate_dnf' option is set to 1, also generate a list of components not fitted on the PCB (HTML only)
html_generate_dnf = 1
; If 'use_alt' option is set to 1, grouped references will be printed in the alternate compressed style eg: R1-R7,R18
use_alt = 0
@cowboy
cowboy / unicornhd-animated-gif.py
Created Aug 4, 2020
animated gif viewer for UnicornHD
View unicornhd-animated-gif.py
#!/usr/bin/env python3
'''
See
https://github.com/HimbeersaftLP/unicorn-hat-hd-gif-displayer/blob/master/unicorn-gif.py
'''
import signal
import time
from sys import exit
@cowboy
cowboy / animate-robots.lua
Created May 5, 2020
OBS Studio script to turn child items of a scene on/off over time
View animate-robots.lua
-- https://obsproject.com/docs/scripting.html
local obs = obslua
-- Globals
local function log(name, msg)
if msg ~= nil then
msg = " > " .. tostring(msg)
else
msg = ""
@cowboy
cowboy / usage.js
Last active Apr 14, 2020
react useLogChanges hook debugging hook
View usage.js
const MyComponent = () => {
const [count, setCount] = useState(0)
useLogChanges('MyComponent', { count, setCount })
return (
<>
<button onClick={setCount}>Increment counter</button>
<div>{count}</div>
</>