Skip to content

Instantly share code, notes, and snippets.

@devdsp
devdsp / main.py
Last active December 17, 2015 08:39
#!/usr/bin/env python
import Image
width, height = 128,512
im = Image.new("RGB", (width,height) )
objective_influence = [[]]*width*height;
def main():
@devdsp
devdsp / gist:4029176
Created November 7, 2012 02:09
pedestrian.tv photography awards; vote sorting hack
jQuery.fn.sortElements = (function(){
var sort = [].sort;
return function(comparator, getSortable) {
getSortable = getSortable || function(){return this;};
var placements = this.map(function(){
@devdsp
devdsp / GoL.v
Created June 6, 2011 04:53
Conway's Game of Life in Verilog
/*
Conway's Game of Life modeled in Verilog by Adam Thomas / devdsp
*/
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <github.com/devdsp> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. - Adam
#include <ht1632.h>
#include <MHV_io_ArduinoDuemilanove328p.h>
HT1632 matrix = HT1632( MHV_ARDUINO_PIN_4,MHV_ARDUINO_PIN_8,MHV_ARDUINO_PIN_10,MHV_ARDUINO_PIN_9, HT1632::pmos_8commons );
void setup() {
digitalWrite(4, HIGH);
Serial.begin(9600);
matrix.set_mode( HT1632::read_mode );
matrix.send_address( 0 );