Skip to content

Instantly share code, notes, and snippets.

View evanfarrar's full-sized avatar

Evan Farrar evanfarrar

View GitHub Profile
#include <stdbool.h>
#include <avr/io.h>
#include <stdlib.h>
#include <avr/pgmspace.h>
#include "kernel/uzebox.h"
#include "data/fonts.pic.inc"
#define WIDTH 39
#define HEIGHT 27
require 'rubygems'
require 'raspell'
class RdocSpellchecker
attr_accessor :badwords
def initialize
@sp = Aspell.new("en")
@sp.set_option("ignore-case","true")
end
def check(dirry)
irb(main):001:0> Infinity = 1/0.0
=> Infinity
irb(main):002:0> Infinity.to_s
=> "Infinity"
irb(main):003:0> class<<Infinity
irb(main):004:1> def to_s
irb(main):005:2> ''
irb(main):006:2> end
irb(main):007:1> end
TypeError: can't define singleton method "to_s" for Float
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"))
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'
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
# 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
#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
(while true
(if (< 0 (. input-stream available))
(print (char (.read input-stream)))
(Thread/sleep 10)
)
)
@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))