Adding code and slides

This commit is contained in:
macournoyer
2008-02-20 14:01:31 -05:00
parent 550e63a97e
commit ef4721aaf5
107 changed files with 61 additions and 0 deletions

3
blank.rb Normal file
View File

@@ -0,0 +1,3 @@
%w(rubygems eventmachine thin thin_parser rack rack/lobster).each { |f| require f }
EM

57
demo.rb Normal file
View File

@@ -0,0 +1,57 @@
%w(rubygems eventmachine thin thin_parser rack rack/lobster).each { |f| require f }
class Connection < EventMachine::Connection
attr_accessor :app
def initialize
@parser = Thin::HttpParser.new
@data = ''
@nparsed = 0
@env = {}
end
def receive_data(data)
@data << data
@nparsed = @parser.execute(@env, @data, @nparsed)
process if @parser.finished?
end
def process
status, headers, body = @app.call(@env)
body_output = ''
body.each { |l| body_output << l }
send_data "HTTP/1.1 #{status} OK\r\n" +
headers.inject('') { |h, (k,v)| h += "#k: #v\r\n" } +
"\r\n" +
body_output
close_connection_after_writing
end
end
welcome_app = proc do |env|
[
200, # Status
{'Content-Type' => 'text/html'}, # Headers
[
'<html><body>',
'<h1>Welcome</h1>',
'<p>Welcome to my server!</p>', # Body
'<p><a href="/rails">My Rails app!</a></p>',
'</body></html>'
]
]
end
rails_app = Rack::Adapter::Rails.new(:root => '/Users/marc/projects/refactormycode', :prefix => '/rails')
app = Rack::URLMap.new('/' => welcome_app, '/rails' => rails_app)
EventMachine.run do
EventMachine.start_server '0.0.0.0', 3000, Connection do |con|
con.app = app
end
end

View File

BIN
slides.key/CachedWeb-1.tiff Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
????????

BIN
slides.key/Picture 1-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
slides.key/Picture 1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
slides.key/Picture 2-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

BIN
slides.key/Picture 2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
slides.key/Picture 3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
slides.key/Picture 4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
slides.key/Picture 5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

BIN
slides.key/bench-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
slides.key/bench.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
slides.key/gitorious.tiff Normal file

Binary file not shown.

BIN
slides.key/index.apxl.gz Normal file

Binary file not shown.

BIN
slides.key/keepalive.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
slides.key/rack.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
slides.key/ramaze.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
slides.key/serious_cat.tiff Normal file

Binary file not shown.

BIN
slides.key/thin.tiff Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
slides.key/thumbs/st0.tiff Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
slides.key/thumbs/st1.tiff Normal file

Binary file not shown.

BIN
slides.key/thumbs/st10.tiff Normal file

Binary file not shown.

BIN
slides.key/thumbs/st11.tiff Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
slides.key/thumbs/st13.tiff Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
slides.key/thumbs/st16.tiff Normal file

Binary file not shown.

BIN
slides.key/thumbs/st2.tiff Normal file

Binary file not shown.

BIN
slides.key/thumbs/st24.tiff Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
slides.key/thumbs/st31.tiff Normal file

Binary file not shown.

BIN
slides.key/thumbs/st33.tiff Normal file

Binary file not shown.

BIN
slides.key/thumbs/st4.tiff Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More