| layout | post |
|---|---|
| title | a facet of Facets |
29 Jul 2009 – Bethesda, MD
I just updated to Rails 2.3.3 and my controllers screamed:
| gem 'google-geocode', :version => '~> 1.2.1', :lib => 'google_geocode' | |
| rake "gems:install" | |
| plugin 'ym4r_gm', :svn => "svn://rubyforge.org/var/svn/ym4r/Plugins/GM/trunk/ym4r_gm" | |
| puts "++++++++++++++++++++++++++++++++++++++++++++++++++++" | |
| puts "Note: ym4r_gm seems to have a problem with Rails 2.2." | |
| puts "But it can be resolved easily: http://railsforum.com/viewtopic.php?id=24839" | |
| puts "++++++++++++++++++++++++++++++++++++++++++++++++++++" |
| plugin 'thinking-sphinx', :git => "git://github.com/freelancing-god/thinking-sphinx.git" | |
| gem "RedCloth", :lib => "redcloth", :source => "http://code.whytheluckystiff.net" | |
| rake "gems:install" | |
| #private URL | |
| plugin 'tog_conversatio', :git => "git@github.com:cauta/tog_conversatio.git" | |
| #public url | |
| #plugin 'tog_conversatio', :git => "git://github.com/cauta/tog_conversatio.git" | |
| route "map.routes_from_plugin 'tog_conversatio'" |
| run "gem sources -a http://gems.github.com" | |
| gem 'desert', :version => '0.5', :lib => 'desert' | |
| gem 'mislav-will_paginate', :version => '~> 2.3.6', :lib => 'will_paginate', :source => 'http://gems.github.com' | |
| gem 'tog-tog', :version => '0.4.4', :lib => 'tog' | |
| rake "gems:install" | |
| plugin 'acts_as_commentable', :svn => "http://juixe.com/svn/acts_as_commentable" | |
| file "db/migrate/" + Time.now.strftime("%Y%m%d%H%M%S") + "_acts_as_commentable.rb", | |
| %q{class ActsAsCommentable < ActiveRecord::Migration |
| Deploying a Rails App with EC2 + S3 + Ubuntu | |
| ============================================ | |
| Create EC2 Instance | |
| ------------------- | |
| create new instance ami-bf5eb9d6 [http://alestic.com/](http://alestic.com/) | |
| create new elastic ip | |
| attach elastic ip to instance | |
| point dns to elastic ip |
| require 'sinatra/metal' | |
| class SinatraMetal < Sinatra::Base | |
| include Sinatra::Metal | |
| get '/sinatra' do | |
| 'hello sinatra!' | |
| end | |
| end |
| # download and git methods swiped from http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb | |
| require 'open-uri' | |
| def download(from, to = from.split("/").last) | |
| #run "curl -s -L #{from} > #{to}" | |
| file to, open(from).read | |
| rescue | |
| puts "Can't get #{from} - Internet down?" | |
| exit! |
| /* | |
| Jquery and Rails powered default application.js | |
| Easy Ajax replacement for remote_functions and ajax_form based on class name | |
| All actions will reply to the .js format | |
| Unostrusive, will only works if Javascript enabled, if not, respond to an HTML as a normal link | |
| respond_to do |format| | |
| format.html | |
| format.js {render :layout => false} | |
| end | |
| */ |
| require 'feedzirra' | |
| # fetching a single feed | |
| feed = Feedzirra::Feed.fetch_and_parse("http://feeds.feedburner.com/PaulDixExplainsNothing") | |
| # feed and entries accessors | |
| feed.title # => "Paul Dix Explains Nothing" | |
| feed.url # => "http://www.pauldix.net" | |
| feed.feed_url # => "http://feeds.feedburner.com/PaulDixExplainsNothing" | |
| feed.etag # => "GunxqnEP4NeYhrqq9TyVKTuDnh0" |
| require "rubygems" | |
| require "superfeedr" | |
| ## You can have all the XMPP logging by changing the Babylon log level | |
| Babylon.logger.level = Log4r::DEBUG | |
| ## | |
| # Don't ever forget that all this is ASYNCHRONOUS... | |
| # If you don't run EM in your program, then it will started for... however, EM.run begin a blocking call, you shoudl probably run it into a specific Thread to keep the rest of your app running :) |