This file contains hidden or 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
Overheard in #philosophy: | |
15:19 daljahim: hey | |
15:20 daljahim: anyone fancy kate perry's new hit? | |
15:20 daljahim: i kissed a girl... | |
15:20 SilentQwerty: "God does not exist" entails that there are sense-data. Therefore God exists. | |
15:20 jseamus: SilentQwerty: how does that logically follow? | |
15:20 daljahim: it doesn't | |
15:21 jseamus: how do you know | |
15:21 jseamus: ? |
This file contains hidden or 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
~/sites/ruby-bluetooth/src(master) $ make | |
gcc -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -c -o bluetooth_macosx.o bluetooth_macosx/bluetooth_macosx.m | |
bluetooth_macosx/bluetooth_macosx.m:2:17: error: ruby.h: No such file or directory | |
bluetooth_macosx/bluetooth_macosx.m:3:19: error: rubyio.h: No such file or directory | |
bluetooth_macosx/bluetooth_macosx.m:4:20: error: rubysig.h: No such file or directory | |
In file included from bluetooth_macosx/bluetooth_macosx.m:13: | |
bluetooth_macosx/bluetooth_macosx.h:13: error: syntax error before ‘VALUE’ | |
bluetooth_macosx/bluetooth_macosx.h:13: warning: no semicolon at end of struct or union | |
bluetooth_macosx/bluetooth_macosx.h:14: warning: data definition has no type or storage class | |
bluetooth_macosx/bluetooth_macosx.h:17: error: syntax error before ‘bt_device_new’ |
This file contains hidden or 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 WebServerTest < Test::Unit::TestCase | |
def setup | |
@valid_request = "GET / HTTP/1.1\r\nHost: www.zedshaw.com\r\nContent-Type: text/plain\r\n\r\n" | |
@port = process_based_port | |
@tester = TestHandler.new | |
@app = Rack::URLMap.new('/test' => @tester) | |
redirect_test_io do | |
# We set num_processors=1 so that we can test the reaping code | |
@server = HttpServer.new("127.0.0.1", @port, @app, :num_processors => 1) |
This file contains hidden or 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 Hand | |
def straight? | |
values = @cards.map{|card| card.value}.uniq.sort | |
n = values.shift | |
while values.first == n || values.count >= 5 | |
n = values.shift | |
end | |
end | |
end |
This file contains hidden or 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 Hand | |
def straight? | |
values = @cards.map{|card| card.value}.uniq.sort | |
values.each do |key, value| | |
values.delete_at(key) unless value == values[key - 1] + 1 | |
end | |
values.length >= 5 | |
end | |
end |
This file contains hidden or 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
# From http://blog.jayfields.com/2008/02/rake-task-overwriting.html | |
class Rake::Task | |
def abandon | |
@actions.clear | |
end | |
end | |
OLD_MIGRATION = Rake::Task["db:migrate"] | |
Rake::Task["db:migrate"].abandon |
This file contains hidden or 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 'prawn' | |
require 'prawn/layout' | |
require 'prawn/format' | |
Prawn::Document.generate("current-events.pdf", | |
:page_size => [432, 810], | |
:left_margin => 0, | |
:right_margin => 0, | |
:top_margin => 0, | |
:bottom_margin => 0) do |
This file contains hidden or 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 'prawn' | |
require 'prawn/layout' | |
require 'prawn/format' | |
Prawn::Document.generate("current-events.pdf", | |
:page_size => [432, 810], | |
:left_margin => 0, | |
:right_margin => 0, | |
:top_margin => 0, | |
:bottom_margin => 0) do |
This file contains hidden or 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 'prawn' | |
require 'prawn/layout' | |
require 'prawn/format' | |
Prawn::Document.generate("current-events.pdf", | |
:page_size => [432, 810], | |
:left_margin => 0, | |
:right_margin => 0, | |
:top_margin => 0, | |
:bottom_margin => 0) do |
This file contains hidden or 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
:headers => ['',cell([0,0], :text => "Febuary"), ''], |