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 Foo | |
attr_reader :start, :stop | |
def initialize(start, stop) | |
@start, @stop = start, stop | |
end | |
def each | |
return enum_for(:each) unless block_given? | |
start.upto(stop) do |count| | |
yield count | |
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
; monads | |
; | |
; references: | |
; http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/ | |
; http://www.intensivesystems.net/tutorials/monads_101.html | |
; | |
; define the 'identity' monad | |
; | |
(define-class <identity> () |
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
; monads | |
; | |
; references: | |
; http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/ | |
; http://www.intensivesystems.net/tutorials/monads_101.html | |
; http://en.wikipedia.org/wiki/Monad_(functional_programming) | |
; | |
(define-method return (monad) | |
(make monad :value)) |
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
; monads | |
; | |
; references: | |
; http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/ | |
; http://www.intensivesystems.net/tutorials/monads_101.html | |
; http://en.wikipedia.org/wiki/Monad_(functional_programming) | |
; http://moonbase.rydia.net/mental/writings/programming/monads-in-ruby/00introduction.html | |
; alternate syntax for make monad | |
(define-syntax return |
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
select | |
count(*) | |
from | |
serial_numbers | |
join boats on | |
boats.id = serial_numbers.boat_id | |
join boat_sizes on | |
boat_sizes.id = boats.boat_size_id | |
join chassis on | |
chassis.id = boats.chassis_id |
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
# Programming Elixir - exercise: ModulesAndFunctions-6 | |
# | |
# Example: | |
# | |
# iex(3)> GuessingGame.search(279, 0..1000) | |
# is it 500 | |
# is it 250 | |
# is it 375 | |
# is it 312 | |
# is it 281 |
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
# Programlog Elixir - exercise: ModulesAndFunctions-6 | |
# | |
# Example: | |
# iex> GuessingGame.search(279, 1..1000) | |
# is it 500? | |
# is it 250? | |
# is it 375? | |
# is it 312? | |
# is it 281? | |
# is it 265? |
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
Given /^(?:|I )am on (.+)$/ do |page_name| | |
visit path_to(page_name) | |
selenium.wait_for_page_to_load(5) | |
end | |
When /^(?:|I )press "([^\"]*)"$/ do |button| | |
click_button(button) | |
selenium.wait_for_page_to_load(5) | |
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
Scenario: unsucessful login | |
Given "John Doe" is a registered user | |
And I am on the login page | |
When I fill in "email" with "John Doe's" user information | |
And I fill in "password" with "incorrect information" | |
And I press "Login" | |
Then I should be on the login page | |
And I should see "Login unsuccessful!" |
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
git config --global user.name "Your Name Comes Here" | |
git config --global user.email you@yourdomain.example.com | |
git config --global core.editor "vim" | |
git config --global core.excludesfile ~/.gitignore | |
git config --global color.diff auto | |
git config --global color.status auto | |
git config --global color.branch auto | |
git config --global color.interactive auto | |
OlderNewer