Skip to content

Instantly share code, notes, and snippets.

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;
}
List<MyThing> things = new List<MyThing> {
this.NewThing().WithAnOffsetDueDateInDays(1),
this.NewThing().WithAnOffsetDueDateInDays(-14)
}
<script type='text/javascript'>
function assertEquals(expected, actual) {
if(expected == actual) {
$('#pass_div').show();
}else{
$('#failure_div').show();
}
}
</script>
<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>
@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
class Array
def last_index
self.length - 1
end
end
def get_my_args(arg1, another_arg)
local_variables.each do |arg_name|
p "#{arg_name} has value #{eval(arg_name)}"
end
end
/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
@coreyhaines
coreyhaines / describe_old_update_sticky_text.js
Created January 3, 2010 21:11
learning to do javascript unit testing
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);
Software Craftsmanship, Beyond The Hype
Software Craftsmanship is prevalent throughout the various software development communities and industries. However, opinions about and definitions of the term abound, both positive and negative, resulting in a confusing cacophony of voices to those trying to understand it. With such an explosive growth, it is sometimes hard to see through the hype. Through the past year, I've traveled far and wide, discussing software craftsmanship with a wide range of people, hearing all sorts of different thoughts on what it means to take on the idea of craftsmanship. While there are varying thoughts and ideas on what 'software craftsmanship' means, there is a recurring fundamental that stands out: helping developers improve their skills as individuals and as members of their community.
In this talk, I'll cut through the hype and present an approach to the 'craft' analogy that can help guide us through our life journey in software development. More than just arm-waving, I will outl