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
(defn square [x] (* x x)) | |
(defn squared-sum [x y] | |
(+ (square x) (square y)) | |
) | |
(defn squared-sum-of-two-greatest [x y z] | |
(if (> x y) | |
(if (> y z) | |
(squared-sum x y) |
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
; Translate the following expression into prefix form http://mitpress.mit.edu/sicp/full-text/book/ch1-Z-G-3.gif | |
; The gif is horrible quality.. so some integers may be wrong.... | |
(/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) | |
(* 3 (- 6 2) (- 2 7))) |
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
; Exercise 1.1. Below is a sequence of expressions. What is the result printed by the interpreter in | |
; response to each expression? Assume that the sequence is to be evaluated in the order in which it is | |
; presented. | |
10 | |
; => 10 | |
(+ 5 3 4) | |
; => 12 | |
(- 9 1) | |
; => 8 |
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
# code | |
class ExternalDataApi | |
def initialize(setup) | |
# do stuff to setup | |
end | |
def list_of_things | |
# grabs stuff from the api and returns an array of OStructs | |
end | |
end |
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
describe Customer, "last billing address" do | |
before do | |
@customer = Customer.generate! | |
@customer = Address.new | |
end | |
it "should be settable and gettable" do | |
@customer.last_billing_address = @account_address | |
@customer.last_billing_address.should == @account_address | |
end | |
... |
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
Scenario Outline: Religious menus | |
Given I am "<Religion>" | |
When I ask to see a menu | |
Then I should be presented a menu with meats entrees | |
<Meats> | |
And I should be presented a menu with hamburger types | |
<Hamburgers> | |
Examples: |
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
default: -r features/support/env.rb -r features/support/plain.rb -r features/step_definitions features/plain | |
selenium: -r features/support/env.rb -r features/support/enhanced.rb -r features/step_definitions features/enhanced |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'tempfile' | |
require 'nokogiri' | |
require 'rdiscount' | |
# makers-mark | |
# | |
# Generates HTML from Markdown, replacing code blocks with syntax |
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
Feature: Backgrounds | |
In order to provide a context to my scenarios within a feature | |
As a feature editor | |
I want to write a background section in my features. | |
Scenario: run a scenario with a background with a passing step | |
When I run cucumber -q features/passing_background_sample.feature:6 | |
Then it should pass with | |
""" | |
Feature: sample |