Skip to content

Instantly share code, notes, and snippets.

View skamithi's full-sized avatar

Stanley Karunditu skamithi

  • Raleigh, North Carolina
View GitHub Profile
@skamithi
skamithi / application_controller.rb
Created April 25, 2012 14:53
Adding Opensearch to my Rails 3.2 app
#app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
def opensearch
response.headers['Content-Type'] = 'application/opensearchdescription+xml; charset=utf-8'
end
@skamithi
skamithi / rails.sh
Created April 23, 2012 00:24
Sample Rails init startup script on ubuntu
### /etc/default/rails ###
APP_USER=vagrant
RVM_SETTING="1.9.3-p125@rails32"
RAILSDIR=/home/vagrant/rails
# Example: STAGES=("vagrant_staging", "vagrant_production")
STAGES=("vagrant_staging")
# Example APPS=("myapp1" "myapp2")
APPS=("myapp")
@skamithi
skamithi / gist:98507
Created April 20, 2009 12:13
how to override a function in rails
How to override a function in rails from Yuhuda Katz. I'm new to ruby and this always confuses me. nice to have a good example from a guru.
class Foo < ActiveRecord::Base
include FooBar
end
module FooBar
def self.included(base)
base.extend(ClassMethods)
end