This file contains hidden or 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
| What and How | |
| Where does variation comes from? What is effectiveness? | |
| As engineers, our tendency is to ask "how". | |
| If we can find ways to do things better, we'll win. | |
| TDD helps us to do things better, so we'll win. |
This file contains hidden or 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 pop(opts={}) | |
| queue.pop(opts) do |header,payload| | |
| donkey.process(header,Donkey::Message.decode(payload)) | |
| end | |
| end | |
| # Public#pop | |
| it "pops a message" do | |
| header = "header" |
This file contains hidden or 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
| /* Prototype JavaScript framework, version 1.6.1 | |
| * (c) 2005-2009 Sam Stephenson | |
| * | |
| * Prototype is freely distributable under the terms of an MIT-style license. | |
| * For details, see the Prototype web site: http://www.prototypejs.org/ | |
| * | |
| *--------------------------------------------------------------------------*/ | |
| var Prototype = { | |
| Version: '1.6.1', |
This file contains hidden or 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 MQ | |
| attr_reader :current_context | |
| def context(hash) | |
| @current_context ||= {} | |
| begin | |
| old_current_context = @current_context | |
| @current_context = @current_context.merge(hash) | |
| yield | |
| ensure |
This file contains hidden or 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
| require 'thread' | |
| queue = Queue.new | |
| workers = 10.times.map do |i| | |
| ts = Thread.new do | |
| loop { | |
| queue.pop.call | |
| Thread.pass | |
| } |
This file contains hidden or 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
| require 'thread' | |
| queue = Queue.new | |
| workers = 10.times.map do |i| | |
| ts = Thread.new do | |
| loop { | |
| queue.pop.call | |
| Thread.pass | |
| } |
This file contains hidden or 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
| require 'rubygems' | |
| require 'rdiscount' | |
| require 'nokogiri' | |
| $blog = [:blog, | |
| [[:timestamps, "2009-03-17T16:04:34-07:00"], | |
| [:title, "Does Ruby Dream An Eclectic Shell?"], | |
| [:categories, "hack"]], | |
| [[:md, | |
| [], |
This file contains hidden or 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
| flet do | |
| def fact(i) | |
| return 1 if i == 1 | |
| i * fact(i-1) | |
| end | |
| def fib(i) | |
| return 1 if i == 0 | |
| return 1 if i == 1 | |
| fib(i-1) + fib(i-2) |
This file contains hidden or 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
| module Abbrev | |
| # Given a set of strings, calculate the set of unambiguous | |
| # abbreviations for those strings, and return a hash where the keys | |
| # are all the possible abbreviations and the values are the full | |
| # strings. Thus, given input of "car" and "cone", the keys pointing | |
| # to "car" would be "ca" and "car", while those pointing to "cone" | |
| # would be "co", "con", and "cone". | |
| # |
This file contains hidden or 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
| <form action="#{search_path}" data-remote="true" data-type="html"> | |
| <div class='section'> | |
| <h2>Dollar Amount Required</h2> | |
| <%= slider(Deal,:dollar_amount_required,:format => "million",:step => 500_000) %> | |
| </div> | |
| <div class='section'> | |
| <h2>Expected IRR</h2> | |
| <%= slider(Deal,:expected_irr,:format => "percent",:step => 50) %> | |
| </div> |