Skip to content

Instantly share code, notes, and snippets.

View tomkersten's full-sized avatar

Tom Kersten tomkersten

View GitHub Profile
def new
#send .nil? then you can stub that on @billing_information
if !user.billing_information.nil?
user.build_billing_information
user.billing_information.first_name = user.first_name
user.billing_information.last_name = user.last_name
user.billing_information.postal_code = user.profile.postal_code
end
define_subscription_details
end

HOWTO: iPhone AT&T Tethering

In 10 steps:

  • Update iTunes to 8.2 via Software Update
  • Update your iPhone to the 3.0 release (out today - June 17th)
  • Download this dmg and mount it: tethering file
  • Enable hidden carrier testing option (in Terminal.app): defaults write com.apple.iTunes carrier-testing -bool TRUE
  • Start up iTunes
@tomkersten
tomkersten / stats.rb
Created September 15, 2009 20:33 — forked from mojombo/stats.rb
# Run the given block +num+ times and then print out the mean, median, min,
# max, and stddev of the run. For example:
#
# irb> stats(10) { sleep(rand / 100) }
# mean: 5.99ms
# median: 6.76ms
# min: 1.49ms
# max: 9.28ms
# stddev: 2.54ms
def stats(num)
@tomkersten
tomkersten / license
Created January 28, 2010 03:44 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Chris Wanstrath
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?

@tomkersten
tomkersten / go.rb
Created June 26, 2010 02:31 — forked from roykolak/go.rb
require 'codefumes_harvester'
include CodeFumesHarvester
# Start the JavaScript Specs build...
QuickBuild.start('javascript specs');
# ...
# if it failed...
QuickBuild.finish('javascript specs', 'failed');
#!/usr/bin/ruby
require 'rubygems'
require 'codefumes_harvester'
def ant_success?
ENV['ANT_RET'] == '0'
end
pub_key = ENV['CF_PUBLIC_KEY']
#!/usr/bin/ruby
require 'rubygems'
require 'codefumes_harvester'
def cuc_success?
ENV['CUC_RET'] == '0'
end
def spec_success?
:sunny:
:zap:
:leaves:
:lipstick:
:cop:
:wheelchair:
:fish:
:hammer:
:moneybag:
:calling: