Skip to content

Instantly share code, notes, and snippets.

View raster's full-sized avatar

Pete Prodoehl raster

View GitHub Profile
@cliffrowley
cliffrowley / STREAMDECK_HID.md
Last active May 7, 2024 00:09
Notes on the Stream Deck HID protocol

Stream Deck Protocol

How to interface with a Stream Deck device.

Synopsis

The device uses the HID protocol to communicate with its software.

Configuration

@PeteMidi
PeteMidi / td3_arp_raw.py
Created July 20, 2020 23:57
TD-3 arpeggiator in Python 3 using numpy and Mido
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on July 7 2020
@author: Pete Midi
"""
import mido
import numpy as np
@tylerneylon
tylerneylon / learn.lua
Last active April 28, 2024 22:23
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@chuckwagoncomputing
chuckwagoncomputing / excuses.sh
Created November 28, 2015 01:14
BOFH excuses
#!/usr/bin/env bash
EXCUSES="/path/to/excuses.txt"
awk 'NR=='$((1 + $RANDOM % `nl $EXCUSES | tail -n 1 | awk '{print $1}' `))'{print;exit}' $EXCUSES
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Jigsaw puzzle</title>
<script type="text/javascript">
function save(filename, data)
{
var blob = new Blob([data], {type: "text/csv"});
@xyzaxyz
xyzaxyz / Gcode_Translator.py
Created April 3, 2018 20:33
MP Scara 3D Printed Robotic Arm Cartesian To Scara GCode Translator Python Script
"""
@author: Tyler Williams
For use with the MPSCARA
Tested in, developed for, and funded by the Solheim Additive
Manufacturing Laboratory at the University of Washington, Seattle.
REQUIRES
settings.txt
Contains:
Machine Name:XXXX
@outadoc
outadoc / pushover
Last active August 17, 2023 16:10
Pushover Bash Script
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: ./pushover <message> [title]"
exit
fi
MESSAGE=$1
TITLE=$2
# This is the code from: https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/circuitpython-wiring-test
# On a Raspberry Pi Pico, WHICH DOES NOT HAVE I2S... Distortion aside, this sounds correct.
# How is that possible?
import time
import array
import math
import audiocore
import board
import audiobusio
@atduskgreg
atduskgreg / photomosaic.pde
Created January 13, 2013 23:12
Processing tool to create a photomosaic from a directory of images. Thoroughly commented as part of a tutorial for @mathpunk.
// Create photomosaics from a source image and a directory of tile images.
// by Greg Borenstein, January 2013
// Read more here:
// see inline comments for more details
// -------------------------------------
// Import the java libraries we need.
// These are both utilites for sorting things.
/**
* code to read one quadratic rotary encoder gray code.
*
* rights: http://tinyurl.com/by-sa-3-0
*/
int inputPin1 = 2; // A
int inputPin2 = 4; // B
int val1 = 0, val2 = 0;
int oldVal1 = 0, oldVal2 = 0;