Skip to content

Instantly share code, notes, and snippets.

View abdul-shajin's full-sized avatar

Abdul Shajin abdul-shajin

  • E2Open
  • Bangalore
View GitHub Profile
@abdul-shajin
abdul-shajin / ubuntu_aliases
Created November 30, 2011 13:40
My aliases
Gist for
alias m='xwit -iconify'
alias log='tail -f log/development.log -n 100'
alias logp='tail -f log/production.log'
alias rd='rdesktop 50.57.123.120 -u "administrator" -p "123456"'
alias go='exit'
alias shajin='ps -ef|grep ruby'
alias kola='kill -9'
alias pt='echo "Process at 3000 port is" && lsof -i tcp:3000|grep *.3000'
@abdul-shajin
abdul-shajin / Ruby-blog-links
Created December 1, 2011 11:09
Ruby_help_links
@abdul-shajin
abdul-shajin / add_index_other_fk
Created December 5, 2011 11:00
Add index with other foreign key
class ActsAsFollowerMigration < ActiveRecord::Migration
def self.up
create_table :follows, :force => true do |t|
t.references :followable, :polymorphic => true, :null => false
t.references :follower, :polymorphic => true, :null => false
t.boolean :blocked, :default => false, :null => false
t.timestamps
end
add_index :follows, ["follower_id", "follower_type"], :name => "fk_follows"
@abdul-shajin
abdul-shajin / rails_reference
Created December 6, 2011 13:18
Quick reference rail
#To load the files under lib directory
config.autoload_paths += Dir["#{config.root}/lib", "#{config.root}/lib/**/"]
Bang::Specification.new do |s|
s.files = ['bang.rb']
s.test_file = 'bang_spec.rb'
s.require_path = '.'
end
class User
bang :calculate_score => :score
def calculate_score
100 # Removed fancy logic for presentational purposes
end
end
#puts nothing.
@abdul-shajin
abdul-shajin / Node_couchdb_links
Created December 20, 2011 09:17
Node couch db references
@abdul-shajin
abdul-shajin / lifelist
Created December 21, 2011 10:17
Places - Like to visit
Venice Canals
Jungfraujoch - Switzerland
Himalaya