Sinatra

2,525 views

Published on

This is a slide of lightning talk session of OSDC.tw 2009. In this slide, we'll show you some example, and deployment tips & tricks on passenger(mod_rails), heroku and Google .

Published in: Technology, Art & Photos
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total views
2,525
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
57
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Sinatra

  1. Sinatra Zero & XDite
  2. Make Ur Calendar Icon
  3. Yes, Make our own!
  4. BA
  5. UUDDLRLRBA
  6. • Full-time student • Works in hypo itsZero • http://itszero.org/ • http://twitter.com/itszero
  7. ...
  8. Sinatra + RMagick
  9. #!/usr/bin/ruby require 'rubygems' require 'sinatra' require 'RMagick' include Magick   FONTPATH = File.dirname(File.expand_path(__FILE__)) + quot;/ Aller/Aller_Bd.ttfquot;   get '/' do   open('public/index.html').read end   get '/gen_icon' do   headers['Content-Type'] = 'image/png'   [some nasty RMagick code...]     canvas.format = 'png'   canvas.to_blob end  
  10. http://makeyourcalicon.heroku.com http://tr.im/j9DH
  11. Another Example Oh, Dear Mr IE6...
  12. PHP / CodeIgniter ?
  13. debug ... by XDite
  14. require ‘twitter_search’
  15. require 'rubygems' require 'sinatra' require 'twitter_search' get '/' do @client = TwitterSearch::Client.new 'politweets' @results = @client.query :q => '@MrIE6' erb :home end
  16. 10 !
  17. db & paginate
  18. activerecord will_paginate
  19. 40
  20. Deployment!
  21. Passenger •( ) Ruby mod_php • Supports Rack!
  22. Rack Handler Adapters • Mongrel • Camping • WEBrick • Sinatra • FastCGI • Merb • Passenger •... •...
  23. Sinatra on Passenger 1 require 'rubygems' 2 require 'sinatra' 3 4 Sinatra::Application.default_options.merge!( 5 :run => false, 6 :environment => :production 7 ) 8 9 require 'make_your_cal_icon.rb' 10 run Sinatra::Application 11 => config.ru
  24. Java on GAE
  25. JRuby + Sinatra + GAE
  26. URLFetching Bumble Will_paginate
  27. http://gae.mrie6.com http://tr.im/j9DK

×