N.B. to run his examples in emacs, you'll want these aliases:
(defalias 'plus #'+)
(defalias 'quotient #'/)
(defalias 'times #'*)
(defalias 'difference #'-)
class Command | |
attr_accessor :pull, :push | |
def initialize(name, *args) | |
@name, @args, @pull, @push = name, args, *IO.pipe | |
end | |
def exec | |
fork do | |
pull.close |
.DS_Store | |
tmp/ |
#!/usr/bin/env PeanutButterJellyTime | |
# ----------------------------------------------------------------------------- | |
# keyword => C equiv (description) | |
# ----------------------------------------------------------------------------- | |
# peanut => ++*ptr (increase value of cell) | |
# PEANUT => ++ptr (move to next cell) | |
# butter => --*ptr (decrease value of cell) | |
# BUTTER => --ptr (move to previous cell) | |
# jelly => putchar(*ptr) (print character value of cell) | |
# JELLY => *ptr=getchar() (store numeric value of char input in cell) |
# slide 77 from waza talk | |
# method definition with static scope, class eval'd in a string | |
# Environment | |
class Foo | |
hello = "world!" | |
define_method("foo") { hello } | |
class_eval "def bar; hello; end" |
[ Launch: General Update Pattern, III ] 5033213 by benolee
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |