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
||: FM7 | Em7 Am7 | FM7 | Em7 A7b9 | FM7 | Em7 Am7 | BbM7#11 C7sus :|| |
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 Integer | |
def factors | |
n, i, sqi, ret = self, 2, 4, [] | |
while sqi <= n do | |
n /= i and ret << i while n % i == 0 | |
sqi += 2 * i + 1 | |
i += 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
state = :ready | |
loop do | |
case state | |
when :ready | |
puts "Ready!" | |
state = :set | |
when :set | |
puts "Set!" | |
state = :go |
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
result = "" | |
while (input = gets.chomp) do | |
case input | |
when 'a' | |
result << input | |
else | |
puts result | |
break | |
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
# pretend include stdio.h, n.b. not Kernel#getc which is deprecated, and | |
# returns bytes. | |
def getc; $stdin.read(1); end | |
def step(state, c) | |
case state | |
when :before | |
if c == "\n" | |
print "\n" | |
else |
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 step(state, c) | |
case state | |
when :before | |
if c == "\n" | |
print "\n" | |
else | |
if c != ' ' | |
print c | |
state = :inside | |
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
Recliner::Database#count with no documents | |
- should be zero | |
Recliner::Database#count with 1 document | |
- should == 1 | |
Recliner::Database.create when it does not exist | |
- should not raise Exception |
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
Recliner::Database.count with no documents | |
- should be zero | |
Recliner::Database.count with 1 document | |
- should == 1 | |
Recliner::Database.create when it does not exist | |
- should not raise Exception | |
- should be ok |
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 | |
def initialize(counter) | |
@counter = 0 | |
instance_eval "def #{counter}; @counter; end" | |
end | |
def call | |
@counter += 1 | |
yield | |
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
emacs -batch -q -no-site-file -eval "(setq load-path (cons (expand-file-name \"./lisp/\") (cons \"/usr/local/share/emacs/site-lisp\" load-path)))" -f batch-byte-compile lisp/org.el | |
End of file during parsing | |
make: *** [lisp/org.elc] Error 255 |