Skip to content

Instantly share code, notes, and snippets.

View willasaywhat's full-sized avatar
:octocat:
Back to building new things!

Willa Riggins willasaywhat

:octocat:
Back to building new things!
View GitHub Profile
@willasaywhat
willasaywhat / keybase.md
Created March 11, 2014 19:03
keybase.md

Keybase proof

I hereby claim:

  • I am abyssknight on github.
  • I am abyssknight (https://keybase.io/abyssknight) on keybase.
  • I have a public key whose fingerprint is 5C58 BA0A A947 4B5A 8B6D 8493 2D72 B6B9 CD2E 322B

To claim this, I am signing this object:

@willasaywhat
willasaywhat / famical.py
Created July 21, 2013 03:41
Google Calendar indicator for FamiLAB Meeting Room
"""
Batch file to read XML and update a display saying whether or not the classroom is in use.
Green if there is no class in the next 8 hours.
Yellow LED if there is a class later today in less than 8 hours.
Red if there is a class in session.
RGB LED <- Arduino ethernet ~ Internal FamiLAB HTTP on Pi <- gcalread output
"""
@willasaywhat
willasaywhat / gist:344c79ea3c31b0273333
Created February 20, 2013 03:28
Digital Out and Digital In with AVR :D (For Attiny4313)
/* Name: main.c
* Author: <insert your name here>
* Copyright: <insert your copyright message here>
* License: <insert your license reference here>
DDRB &= ~_BV(DDB2); //clear pin state
val = PINB & _BV(PB2); //get value of the pin
*/
#include <avr/io.h>
@willasaywhat
willasaywhat / gist:53bdb391edca780146b3
Created February 10, 2013 22:34
Famicorder + Mario (slow)
/*
FamiCorder - An electronic recorder for awesomeness.
By: WCR, Jamie Szafran, Mike King
Pins: http://i.imgur.com/GZrkhcZ.png
*/
// Notes stolen from pitches.h in the example files
@willasaywhat
willasaywhat / gist:1586278
Created January 10, 2012 01:43
Arduino 22 - TC74 Code
#include <Wire.h>
#define i2c_addr 0x4F
void setup() {
Serial.begin(9600);
Wire.begin();
}
void loop() {
Arduino Ethernet for 810MJ
SCK to D13
MISO to D12
MOSI to D11
SCS to D10
3.3V supply
Ground
import cv
import sys
img = cv.LoadImage(sys.argv[1], 0)
hist = cv.CreateHist([32], cv.CV_HIST_ARRAY, [[0, 255]], 1)
cv.CalcHist([img], hist, 0, None)
hist_img = cv.CreateImage((32*10,255), 8, 3)
(_,max_value,_,_) = cv.GetMinMaxHistValue(hist)
(sizex, sizey) = cv.GetSize(img)
@willasaywhat
willasaywhat / grades.py
Created May 10, 2010 18:00
Grade point average from letter grades.
grades_txt = """C+
A-
A-
B+
B-
B
C-
B
B
B
@willasaywhat
willasaywhat / lev-dist.rb
Created September 3, 2009 19:24
Levenshtein distance algorithm in Ruby
class Distance
attr_accessor :s1, :s2
def initialize(str1,str2)
@s1 = str1
@s2 = str2
end
def lev_distance
m = @s1.length
@willasaywhat
willasaywhat / merge-sort.rb
Created September 3, 2009 19:22
Merge sort implemented in Ruby
def merge_sort(m)
if m.length <= 1
return m
end
middle = m.length / 2 - 1
left = m[0..middle]
right = m[middle+1..m.length]
left = merge_sort(left)
right = merge_sort(right)
if left.last > right.first