Skip to content

Instantly share code, notes, and snippets.

View rossmeissl's full-sized avatar

Andy Rossmeissl rossmeissl

View GitHub Profile
@rossmeissl
rossmeissl / automobile_options.rb
Created June 10, 2010 19:00
Trying to figure out how to disaggregate a model so that its important bits can be open-sourced
# This is what we have in our app now:
class Automobile < ActiveRecord::Base
include Leap # provides #decide classmethod
decide :emission do
# important stuff described in DSL
end
# lots of other boring stuff
TRAVEL_DISTANCE_INSIDE_ZIP_CODE = 7.89 #km
TRAVEL_DOGLEG_FACTOR = 1.259
TRAVEL_EMITTERS = {
:flight => 100..25000, # circumference of the earth
:rail_trip => 0..2500, # nyc -> la
:automobile => 0..2500,
:bus_trip => 0..2500
}
TRAVEL_WIZARD_CHARACTERISTIC_ORDER = {
:flight => [:origin_airport, :destination_airport, :emplanements_per_trip, :load_factor],
@rossmeissl
rossmeissl / bombshell_completion_features
Created March 9, 2011 00:52
Bombshell completion features via cucumber binary
1.9.2p0 vagrant@vagrantup:~/bombshell$ bundle exec cucumber features/completion.feature
Feature: Completion
In order to expedite my exploration
As a user of a Bombshell-enabled Ruby library
I want to be able to use tab completion
Scenario: Single matching command # features/completion.feature:7
Given a file named "fooshell.rb" with: # aruba-0.3.2/lib/aruba/cucumber.rb:66
"""
(1:03:32 PM) Seamus Abshere: vidalia:~ $ smartermeter
SmarterMeter: Initial Configuration
--------------------------------------------------------------------------------
This program stores your PG&E account username and password on disk. The
password is encrypted but could be retrieved fairly easily. If this makes you
uncomfortable quit now (use ctrl-c).
--------------------------------------------------------------------------------
PG&E account username: robbieadler
PG&E account password: ****
@rossmeissl
rossmeissl / gist:1434529
Created December 5, 2011 17:46
Canvas element as mesh material
var canvas = document.createElement('canvas', { style: "background: none" });
canvas.width = 400;
canvas.height = 25;
var context = canvas.getContext('2d');
context.fillStyle = 'blue';
context.fillText(labelText, 0, 0);
var material = new THREE.MeshBasicMaterial(canvas);
var geometry = new THREE.PlaneGeometry(400,25);
var plane = new THREE.Mesh( geometry, material);
@rossmeissl
rossmeissl / 2012-03-20.markdown
Created March 31, 2012 18:59
Full House Smoothies
  • Half-bunch kale or collards
  • 2 bananas
  • Handful frozen blueberries
  • 3 frozen strawberries
  • Splash orange juice
  • Handful granola
  • 1 c. whole milk yogurt
  • Vanilla whey protein
  • Splash water
@rossmeissl
rossmeissl / pge.rb
Created July 17, 2012 19:11
Sparkwire
require 'mechanize'
require 'logger'
require 'uri'
agent = Mechanize.new
agent.follow_meta_refresh = :always
agent.log = Logger.new 'mech.log'
agent.user_agent_alias = 'Mac FireFox'
puts 'Initialize the session by loading the login form'

Keybase proof

I hereby claim:

  • I am rossmeissl on github.
  • I am rossmeissl (https://keybase.io/rossmeissl) on keybase.
  • I have a public key whose fingerprint is 620F 5BC1 9255 10BE 786A 6457 3AFD B179 1AF7 1CD0

To claim this, I am signing this object:

@rossmeissl
rossmeissl / manifest-full.txt
Created July 15, 2014 15:07
Census block group data URLs for all states
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_01_bg.zip
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_02_bg.zip
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_04_bg.zip
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_05_bg.zip
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_06_bg.zip
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_08_bg.zip
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_09_bg.zip
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_10_bg.zip
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_11_bg.zip
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_12_bg.zip
@rossmeissl
rossmeissl / manifest-sample.txt
Last active August 29, 2015 14:04
Census block groups data URLs (just California)
ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/tl_2013_06_bg.zip