Skip to content

Instantly share code, notes, and snippets.

View iamjwc's full-sized avatar

Justin Camerer iamjwc

  • LimeWire, LLC
  • New York City
View GitHub Profile
var gia = (function (obj){
var stateEV=[["Alabama","AL",9,"SR"],["Alaska","AK",3,"SR"],["Arizona","AZ",11,"SR"],["Arkansas","AR",6,"SR"],["California","CA",55,"SO"],["Colorado","CO",9,"T"],["Connecticut","CT",7,"LO"],["Delaware","DE",3,"SO"],["Dist. of Columbia","DC",3,"SO"],["Florida","FL",29,"T"],["Georgia","GA",16,"SR"],["Hawaii","HI",4,"SO"],["Idaho","ID",4,"SR"],["Illinois","IL",20,"SO"],["Indiana","IN",11,"SR"],["Iowa","IA",6,"T"],["Kansas","KS",6,"SR"],["Kentucky","KY",8,"SR"],["Louisiana","LA",8,"SR"],["Maine","ME",4,"SO"],["Maryland","MD",10,"SO"],["Massachusetts","MA",11,"SO"],["Michigan","MI",16,"LO"],["Minnesota","MN",10,"SO"],["Mississippi","MS",6,"SR"],["Missouri","MO",10,"LR"],["Montana","MT",3,"SR"],["Nebraska","NE",5,"SR"],["Nevada","NV",6,"T"],["New Hampshire","NH",4,"T"],["New Jersey","NJ",14,"SO"],["New Mexico","NM",5,"SO"],["New York","NY",29,"SO"],["North Carolina","NC",15,"T"],["North Dakota","ND",3,"SR"],["Ohio","OH",18,"T"],["Oklahoma","OK",7,"SR"],["Oregon","OR",7,"SO"],["Pennsylvan
filetype off
"call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
" first clear any existing autocommands:
autocmd!
set nocompatible
" http://items.sjbach.com/319/configuring-vim-right
@iamjwc
iamjwc / migrant_work_enqueuer.rb
Created August 21, 2015 20:21
File takes a CSV of "okey,root_okey,source_okey" and enqueues work for the "SetRootAndSourceProjectIdsProcessor".
def enqueue_for_migrant_work(okey, root, source)
queue_name = "migrant_worker_$$$ENVIRONMENTNAME$$$"
payload = {
'processor' => 'SetRootAndSourceProjectIdsProcessor',
'okey' => okey,
'root' => root,
'source' => source,
}
@iamjwc
iamjwc / maze.go
Last active October 16, 2015 17:58
// go-race
// width: `tput cols`
// height: `tput lines`
// Our generated maze needs to be just less than 1/2 the size of our
// terminal size, so we can have room to print walls.
//
// Each cell is an integer. Each wall on the cell (N, E, S, W) are
// represented by a bit. If a wall exists only on the north side,
class Hash
def flarp(h = {}, prefix = nil)
each do |k, v|
new_k = [prefix, k].compact.join(".")
if v.is_a?(Array) || v.is_a?(Hash)
v.flarp(h, new_k)
else
h[new_k] = v
end
@iamjwc
iamjwc / flarp.rb
Last active May 20, 2016 16:07
Flattens hashes/arrays into a single level hash with the full json key path as a top level key. Useful for finding differences between two large manifests.
# Usage:
# (irb)> { "some" => [{"keys" => "with", "some" => ["values"]}]}.flarp
# => {"some.0.keys"=>"with", "some.0.some.0"=>"values"}
class Hash
def flarp(h = {}, prefix = nil)
each do |k, v|
new_k = [prefix, k].compact.join(".")
if v.is_a?(Array) || v.is_a?(Hash)
import Debug.Trace
-- Problem 0
helloWorld :: [Char]
helloWorld = "Hello World"
-- Problem 1
myLast :: [a] -> a
myLast = head . reverse