Skip to content

Instantly share code, notes, and snippets.

View zspencer's full-sized avatar

Zee zspencer

View GitHub Profile
@zspencer
zspencer / config.yml
Created March 3, 2013 18:03
Host assets on CloudFront while keeping HTML on S3 with Jekyll
asset_url:
- production: http://assets.zeespencer.com/assets
- development: /assets
@zspencer
zspencer / .rvmrc
Last active December 12, 2015 07:28
A parser that takes tweets and builds relationships between tweeters.
rvm use system@network-graph --create
@zspencer
zspencer / things.rb
Created January 30, 2013 02:23
blocks, procs, lambdas, and methods
class String
def fuck_yea(&block)
each_char do |c|
p yield(c)
end
end
def fuck_yea_with_callback(callback)
each_char do |c|
callback.call(c)
(verse 1)
The boss thinks you are get-ting la-zy and fat,
Want's you to get up and get off your ass.
What's a better motivator than a stat?
Even better if it just happens like that.
Take off your shoes and walk on the grass
I'm on your belt and I don't take any sass
(chorus)
@zspencer
zspencer / tic_tac_toe_kata.rb
Last active December 10, 2015 18:38
Playing around with custom contexts in rspec for making succinct yet communicative test definitions and defining methods to be used as blocks.
class TicTacToe < Struct.new(:board)
CATS_GAME = :c; INCOMPLETE_GAME = :e; PLAYERS = [:x, :o]
def winner
winning_row.first
end
private
def clear_winner?
!winning_permutation.nil?
@zspencer
zspencer / custom_assertion_spec.rb
Created November 24, 2012 21:31
3 Variations of Spec Files
require './numeral_converter'
require 'minitest/autorun'
describe NumeralConverter do
describe "#to_roman" do
it "converts 1 to I" do
1.must_equal_roman "I"
end
it "converts 2 to II" do
2.must_equal_roman "II"
@zspencer
zspencer / gist:3784043
Created September 25, 2012 19:51 — forked from nhajratw/gist:3783890
accessing functions??
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
var id;
var inProgressDate;
var acceptedDate;
var cycleTime;
@zspencer
zspencer / gist:3499091
Created August 28, 2012 15:26
Eye of the Slacker
It's the eye of the slacker
He's been vegging all night
Sitting down watching reruns of Lost...
And the last season of survivor has a double feature tonight
And he's watching them all
With the eye of the slacker
@@ -29,10 +29,40 @@
"average": 0.0,
"count": 0
},
- "score": 22.5,
+ "score": 11.25,
"strict_match": true
},
{
+ "address": "Parnell, Auckland 1010 New Zealand",
@zspencer
zspencer / chords.txt
Created July 28, 2012 15:04
Just a Battery
## Just a Battery
Rough Cut: http://zeespencer.com/assets/music/JustABatteryRough.mp3
Verses: C/Am/F/G
Chorus: C/G/F
Bridge: C/F
I stay up late every night
Bathed in computer light
Wake up and take a walk