Skip to content

Instantly share code, notes, and snippets.

View evanfarrar's full-sized avatar

Evan Farrar evanfarrar

View GitHub Profile
evan@ubuntu ~/D/opensprints-comm> stty -F /dev/ttyUSB0
speed 115200 baud; line = 0;
eof = ^A; min = 1; time = 0;
ignbrk -brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok noflsh -echoctl -echoke
@evanfarrar
evanfarrar / index.txt
Created December 1, 2009 05:03 — forked from corey/index.txt
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
@evanfarrar
evanfarrar / repl.clj
Created November 29, 2009 02:26 — forked from olaugh/repl.clj
(import '(org.eclipse.swt SWT))
(import '(org.eclipse.swt.widgets Display Shell Widget))
(import '(org.eclipse.swt.graphics Font))
(import '(org.eclipse.swt.events ControlAdapter))
(import '(org.eclipse.swt.custom StyleRange StyledText VerifyKeyListener))
(def *display* (new Display))
(def *shell* (new Shell *display*))
(def *repl* (new StyledText *shell* SWT/BORDER))
(while true
(if (< 0 (. input-stream available))
(print (char (.read input-stream)))
(Thread/sleep 10)
)
)
#one
button $i18n.save do
if((tournament.racers-[racer]).any? { |r| racer.name == r.name })
alert("Racer is already in this event.")
elsif racer.name.blank?
alert "Sorry, name is required."
elsif old_racer = Racer.filter(:name => racer.name).exclude(:id => racer.pk).any?
create_old_racer(old_racer, new_racer, tournament)
visit "/races/#{race_id}/edit"
else
# Using code to match non-free fonts to free fonts.
# (Delicious won, by the way).
fontslist =[]
Dir.glob('media/fonts/*').each do |f|
fontslist << font(f)
end
font('media/AvenirLTStd-Black.otf')
Shoes.app do
stack do
require 'rubygems'
require 'dm-core'
DataMapper.setup(:default, 'sqlite3::memory:')
class Tournament
include DataMapper::Resource
property :id, Serial
has n, :races
has n, :tournament_participations
has n, :racers, :through => :tournament_participations, :mutable => true
name' do
- @racer.name = "Evan F"
- diff --git a/test/racer_test.rb b/test/racer_test.rb
index 757e79c..ca54e16 100644
--- a/test/racer_test.rb
+++ b/test/racer_test.rb
@@ -1,25 +1,17 @@
require 'lib/setup.rb'
-require 'bacon'
+require 'protest'
class Foo < Shoes
url '/', :index
url '/bar', :bar
url '/two', :two
def index
clear
para "hello from Foo"
para(link("/", :click => "/"))
para(link("/bar", :click => "/bar"))