Skip to content

Instantly share code, notes, and snippets.

View zspencer's full-sized avatar

Zee zspencer

View GitHub Profile
@zspencer
zspencer / solution 1
Created May 1, 2012 00:33
Solutions to rubywarrior level 8, arrived at genetically
rest!,backward,attack!,forward,attack!,forward,shoot!,forward,walk!,forward,walk!,forward,pivot!,backward,shoot!,forward,rest!,forward,attack!,backward,walk!,backward,attack!,backward,attack!,forward,rest!,forward,walk!,backward,shoot!,backward,shoot!,backward,attack!,backward,walk!,backward,pivot!,forward,attack!,backward,pivot!,backward,walk!,forward,pivot!,backward
class Player
def initialize
end
def play_turn(warrior)
@warrior = warrior
move_forward
@zspencer
zspencer / bootstrap.sh
Created May 30, 2012 02:04
Bootstrapping like a boss
#symlink gcc to a non-llvm version installed xCode's CLI tools
if [ -f /usr/bin/gcc-4.2 ]; then
sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/gcc
sudo rm /usr/bin/cc
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/cc
fi
@zspencer
zspencer / a.js
Created June 23, 2012 17:17
A step by step refactoring where I separate a jquery plugin into pieces with reduced responsibilities.
/*
This first iteration only paginated an initial set of pages. Adding or removing pages without
reinitializing the plugin would stay with the initial set.
Everything was encapsulated within a single jQuery plugin which knew everything about pagination:
* buttons/etc for moving around pages
* jumping to a page
* animating moving to a new page
* where in the dom the page numbers were stored
* updating the ui based upon which page you scrolled to
@zspencer
zspencer / active_record.class.php
Created July 10, 2012 23:48
I found this PHP implementation of 'active record' I did nearly 7 years ago. Below you see an implementation of a model.
<?php
class active_record
{
function table_name()
{
return get_class($this);
}
function conf($conf=NULL)
@zspencer
zspencer / .gitignore
Created July 14, 2012 20:25
The shitty script I threw together to keep my DAS updated.
credentials.rb
chromedriver.log
.rvmrc
Gemfile.lock
@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
@@ -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 / 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
@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;