Skip to content

Instantly share code, notes, and snippets.

||: FM7 | Em7 Am7 | FM7 | Em7 A7b9 | FM7 | Em7 Am7 | BbM7#11 C7sus :||
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
state = :ready
loop do
case state
when :ready
puts "Ready!"
state = :set
when :set
puts "Set!"
state = :go
result = ""
while (input = gets.chomp) do
case input
when 'a'
result << input
else
puts result
break
end
end
# 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
def step(state, c)
case state
when :before
if c == "\n"
print "\n"
else
if c != ' '
print c
state = :inside
end
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
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
class Foo
def initialize(counter)
@counter = 0
instance_eval "def #{counter}; @counter; end"
end
def call
@counter += 1
yield
end
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