Skip to content

Instantly share code, notes, and snippets.

@adambair
adambair / dsa.js.coffee
Created October 28, 2011 13:17
Destructuring Assignment in CoffeeScript
first, last = ["Jake", "Mauer"]
first, last = "Jake Mauer".split(" ")
# Also see http://blog.carbonfive.com/2011/09/28/destructuring-assignment-in-coffeescript
@adambair
adambair / rstat.rb
Created November 3, 2011 17:08
Print out Git stats on a repo using Ruby
#!/usr/bin/ruby
require 'yaml'
contributions = {}
`git log --shortstat -z`.each("\0") do |commit|
commit.match(/Author: (\w+) /)
author = $1
commit.match(/(\d+) files changed, (\d+) insertions\(\+\), (\d+) deletions\(\-\)/)
@adambair
adambair / data.csv
Created December 12, 2011 16:14 — forked from clr/data.csv
Planet Finder RubyGames
Life DistanceWithin3AU TempUnder375 Water Atmosphere ClassM GasGiant
0 0 0 0 1 0 1
0 1 1 0 1 0 0
0 1 0 0 0 0 0
0 0 0 0 1 0 0
0 1 0 0 1 0 1
0 1 0 1 0 0 1
0 1 1 0 1 0 1
1 0 1 1 1 0 0
0 1 0 0 1 0 1
def apple_product_titleize(name)
name[0] + name[1].capitalize + name[2..-1]
end
@adambair
adambair / v1
Created February 22, 2012 22:03
-------------------------------------------------------------
iIIIIIIIIIIIIIIi,
II 'IIi. Intridea, Inc
II 'Ii www.intridea.com
II iii II
II 'ii II Document Title Here
II II 12/05/2011 - 12/06/2011
II iii II
II. iii .II Adam Bair, Partner
@adambair
adambair / protip-tmux-radness
Created March 20, 2012 16:58 — forked from renaehodgkins/tmux-protip-radness
protip tmux radness
#protip add 'new-session' to your .tmux.conf -- then add 'tmux attach' to the end
of your .bashrc/.profile/.zshrc or whatever to automatically connect or
create a new session. It's fucking rad.
https://img.skitch.com/20120320-drb6wifhbmy3n2137s2chymrn1.jpg
@adambair
adambair / .tmux.conf
Created March 21, 2012 14:27 — forked from jondkinney/README.md
j2fly's vim setup, install with: exec 3<&1;bash <&3 <(curl https://raw.github.com/gist/2040114/vim.sh 2> /dev/null)
# Our .tmux.conf file
# Setting the prefix from C-b to C-a
# START:prefix
set -g prefix C-a
# END:prefix
# Free the original Ctrl-b prefix keybinding
# START:unbind
unbind C-b
@adambair
adambair / gist:2776441
Created May 23, 2012 17:13
all_products_sales
{
"name":"Corsair - Obsidian 650D System Cabinet - Black",
"description":"",
"url":"http://www.bestbuy.com/site/Corsair - Obsidian 650D System Cabinet - Black/3228633.p?id=1218390965457",
"image":[
{
"style":"thumbnail",
"url":"http://s3.amazonaws.com/zazoola/production/products/images/2/thumbnail.png?1337745723"
},
@adambair
adambair / work-with-me.md
Last active December 18, 2015 00:58
Full-time Rails Developer at Openbay.com (Cambridge, MA) [06/03/13]

Full-time Rails Developer at Openbay.com (Cambridge, MA) [06/03/13]

Enjoy writing software? Software that takes the pain out of having your auto serviced? EXCELLENT. Join us at Openbay.com. We're an online marketplace that connects vehicle owners to service providers (mechanics, shops, etc) through real time quotes, payments, and messaging. Vehicle owners love us because it's easier and cheaper to get their car serviced; we take the guesswork out of choosing the right shop. Provders love us because they gain more customers while spending less on advertizing.

Still interested? On the fence? Questions? Is working for a starup risky? What will I be doing? Who will I be working with? Should I quit my job right now and join them (probably)? LET'S TALK (adam@openbay.com).

You'll be our second developer hire. You'll be working with me. For me? With me. We'll work together. Oh the beautiful things we shall build! When we're finished vehicles will practiclly fix themselves! Openbay already has real customers

before_save :set_expiration_date
def expired?
expires_at > Time.now
end
def set_expiration_date
expires_at = Time.now + 6.months
end