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
## Creates a gamma-corrected lookup table | |
import math | |
def gamma(nsteps, gamma): | |
gammaedUp = [math.pow(x, gamma) for x in range(nsteps)] | |
return [x/max(gammaedUp) for x in gammaedUp] | |
def rounder(topValue, gammas): | |
return [min(topValue, round(x*topValue)) for x in gammas] |
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
use <hull.scad> | |
w = 66.35; | |
l = 79; | |
pin_locations = [ [-w/2, -l/2, 0], [-w/2, l/2, 0], | |
[ w/2, -l/2, 0], [ w/2, l/2, 0] ]; | |
thickness = 1; | |
$fn = 24; |
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 bash | |
[ $# -eq 0 ] && echo "Usage: randomNIST number_contestants [pulseIndex]" && exit | |
[ $# -eq 1 ] && number_contestants=$1 && pulseIndex=last | |
[ $# -eq 2 ] && number_contestants=$1 && pulseIndex=$2 | |
# convert to hexadecimal | |
number_contestants=$(echo "ibase=10 ; obase=16 ; $number_contestants" | bc) | |
randomHex=$(curl https://beacon.nist.gov/beacon/2.0/chain/2/pulse/${pulseIndex} | grep outputValue | cut -d \" -f 4) |
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/bash | |
clear | |
# init colors | |
FG="#00ffff" | |
BFG="#00ff00" | |
# if you wonder why true is in there https://www.shellcheck.net/wiki/SC2015 | |
gum confirm --default --affirmative="Play now" --negative="Dump source first" --timeout=10s "Would you like to view the source code before playing?" &amp;&amp; true || ( gum format -t code &lt;"$0" ) | |
# get initial info | |
gum style --foreground "$FG" --border-foreground "$BFG" --border double --align center --width 64 --margin "1 2" --padding "2 4" \ |
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 python | |
## Simple controller shell to interface with MPC with minimal keystrokes | |
## Note: ssh -p 23 -L 6600:audiobox:6600 elliotwilliams.org | |
## makes it work from remote locations. Tunnels into my network. :) | |
import mpdclient2, time, pdb, curses, os | |
import cPickle as pickle | |
## os.system("export MPD_HOST='audiobox'") |
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
/******************************************************************************* | |
TINY TACHOMETER | |
TACOMETRO C/ PIC12F675 E LCD (M�TODO LPLEX - 3 FIOS) | |
METODO: LEITURA DO PERIODO |
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 serial | |
import subprocess | |
SENSITIVITY=250 | |
PORT1="/dev/ttyUSB1" | |
DEBUG = False | |
DELAY = 0.25 ## seconds, prevents race |
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 bash | |
number_contestants=$1 | |
# convert to hexadecimal | |
number_contestants=$(echo "ibase=10 ; obase=16 ; $number_contestants" | bc) | |
# take image | |
ffmpeg -f v4l2 -i /dev/video0 -frames:v 1 -y foo.png | |
# md5sum it and extract the value |
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
module multiHull(){ | |
for (i = [1 : $children-1]) | |
hull(){ | |
children(0); | |
children(i); | |
} | |
} | |
module sequentialHull(){ | |
for (i = [0: $children-2]) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder