Skip to content

Instantly share code, notes, and snippets.

@hughpyle
hughpyle / amulet.py
Created February 25, 2021 15:38
amulet
#!/usr/bin/env python3
"""
amulet (https://text.bargains/amulet/)
"""
import sys
import hashlib
from copy import copy
from multiprocessing.dummy import Pool as ThreadPool
@hughpyle
hughpyle / remote.ino
Created September 5, 2016 18:17
Teensy remote control for MiniDSP 2x4 HD
#include <ir_Lego_PF_BitStreamEncoder.h>
#include <IRremote.h>
#include <IRremoteInt.h>
/* This is a special-purpose infrared "remote control" to control vokume and channel selecion for the MiniDSP */
/* Hardware: Teensy 3.x, two rotary hex encoders (I used 25LB22-H), and a generic IR LED */
int UP = 1;
int DOWN = -1;
int NONE = 0;

Keybase proof

I hereby claim:

  • I am hughpyle on github.
  • I am hughpyle (https://keybase.io/hughpyle) on keybase.
  • I have a public key whose fingerprint is A0AB 633B 05DA C9D2 28EB 8AC0 7B6D D9D1 32C1 929D

To claim this, I am signing this object:

@hughpyle
hughpyle / xmaslights2013.ino
Created December 13, 2013 16:16
Sparkly patterns for a festive tree decorated with LPD8806 LED striplight. The base is a gently-changing colorwheel that rotates along the strip (downward). The base is modulated a faster sparkly colorwheel rotating upward.
/*
Lights for a tree (3m strip)
2013-12-10 @hughpyle, (cc) https://creativecommons.org/licenses/by/3.0/
Structure is based on the Adafruit "advancedLEDBeltKit.pde" example
Colorwheel and sparkle use the Minsky circle algorithm http://cabezal.com/misc/minsky-circles.html
*/
// LPD8806 library is from https://github.com/adafruit/LPD8806
@hughpyle
hughpyle / SquareR
Last active December 15, 2015 04:50
Solution to BigInteger square root puzzle http://corner.squareup.com/2013/03/puzzle-square-root.html
/*
Solution to biginteger square root puzzle http://corner.squareup.com/2013/03/puzzle-square-root.html
Uses a timing attack on BigInteger.divide(), which has a very large performance difference
depending whether the divisor is larger or smaller than this.
Times multiple iterations to try avoid jitter. Not at all optimized for speed :-)
*/
package square;