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
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 | |
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
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: |
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
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: |
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
(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)) | |
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
(while true | |
(if (< 0 (. input-stream available)) | |
(print (char (.read input-stream))) | |
(Thread/sleep 10) | |
) | |
) |
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
#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 |
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
# 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 |
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
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 |
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
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' |
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 < Shoes | |
url '/', :index | |
url '/bar', :bar | |
url '/two', :two | |
def index | |
clear | |
para "hello from Foo" | |
para(link("/", :click => "/")) | |
para(link("/bar", :click => "/bar")) |