This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public MyThing thing(DateTime duedate){ | |
return new MyThing {DueDate = duedate}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ThingTestingUtilities { | |
public static Thing NewThing(this TestsThings tester) { | |
return new MyThing; | |
} | |
public static Thing WithDueDate(this MyThing thing, DateTime duedate) { | |
thing.DueDate = duedate; | |
return thing; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<MyThing> things = new List<MyThing> { | |
this.NewThing().WithAnOffsetDueDateInDays(1), | |
this.NewThing().WithAnOffsetDueDateInDays(-14) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='pass_div' style='width:200px;background-color:green'>Pass</div> | |
<div id='fail_div' style='width:200px;background-color:red'>Fail</div> | |
<ul> | |
<li><a onclick='first_thing_to_check()'>first_thing_to_check</a></li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript'> | |
function assertEquals(expected, actual) { | |
if(expected == actual) { | |
$('#pass_div').show(); | |
}else{ | |
$('#failure_div').show(); | |
} | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@times_2_green = [] | |
Autotest::add_hook :all_good do |at| | |
@times_2_green << Time.now.to_i | |
data = [] | |
@times_2_green.uniq.each_with_index do |time, index| | |
if index > 0 | |
data << time - @times_2_green[index-1] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
def last_index | |
self.length - 1 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_my_args(arg1, another_arg) | |
local_variables.each do |arg_name| | |
p "#{arg_name} has value #{eval(arg_name)}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/coreyhaines/.gem/ruby/1.8/gems/heroku-1.5.3/bin/../lib/heroku/command.rb:43:in `run_internal': undefined method `new' for Rake:Module (NoMethodError) | |
from /Users/coreyhaines/.gem/ruby/1.8/gems/heroku-1.5.3/bin/../lib/heroku/command.rb:17:in `run' | |
from /Users/coreyhaines/.gem/ruby/1.8/gems/heroku-1.5.3/bin/heroku:14 | |
from /usr/bin/heroku:19:in `load' | |
from /usr/bin/heroku:19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("#old_update_sticky_text", function(){ | |
before(function(){ | |
this.sticky_update_url_for = function(x) { return null; } | |
this.parent_sticky = function(x) { return null; } | |
this.update_sticky = function(x) { return null; } | |
}); | |
it("returns the value passed in", function(){ | |
var value = old_update_sticky_text("foo", null); |