Skip to content

Instantly share code, notes, and snippets.

- Finish volunteer form stuff
- Multipage volunteer form
- Check links on registration index page
- Editing for registrations
@aperley
aperley / schema_string_changer.rb
Created April 30, 2013 02:07
Writes the migration to change all db string columns to text.
module ActiveRecord
class Schema
def self.define(options, &block)
instance_eval(&block)
end
def self.create_table(name, opts, &block)
yield StringLogger.new name
end
def self.method_missing(method, *args, &block)
@aperley
aperley / vector.py
Last active October 26, 2015 13:07
Vector.py
class Vector(object):
def __init__(self, components):
self.components = components
self.dims = len(components)
def __add__(self, other):
self._check_dims(other)
return self.__class__([comp1 + comp2 for comp1, comp2 in zip(self.components, other.components)])
def __sub__(self, other):
@aperley
aperley / example.py
Created November 20, 2014 02:14
Modular Graphics
class Game(AnimationClass):
def __init__:
self.gameObjects = ...
def onTimerFired:
for obj in self.gameObjects:
obj.update()
for otherObj in self.gameObjects:
if obj == otherObj: continue
if obj.collide(otherObj):
@aperley
aperley / pose_visualizer.js
Created December 11, 2016 23:18
Rover Visualizer
function PoseVisualizer(el, width, height) {
this.el = el;
this.scene = new THREE.Scene();
this.camera = camera = new THREE.PerspectiveCamera( 45, width/height, 1, 10000 );
this.camera.position.z = 1000;
this.camera.position.y = 500;
this.camera.lookAt( new THREE.Vector3(0, 0, 0) );