This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capistrano/setup' | |
require 'capistrano/deploy' | |
require 'capistrano/rvm' | |
require 'capistrano/rails' | |
require "capistrano-resque" | |
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _authenticate_oauth_echo | |
require 'httparty' | |
# header auth only for now; also lock down the auth provider endpoint so we can't spoof | |
if(request.env["HTTP_X_AUTH_SERVICE_PROVIDER"] != 'https://api.twitter.com/1/account/verify_credentials.json' || request.env["HTTP_X_AUTH_SERVICE_PROVIDER"].blank?) | |
return false | |
else | |
auth_service_provider = request.env["HTTP_X_AUTH_SERVICE_PROVIDER"] | |
verify_credentials_authorization = request.env["HTTP_X_VERIFY_CREDENTIALS_AUTHORIZATION"] | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is an example of using RVM's Project .rvmrc file | |
to have it automatically bootstrap your environment, including bundler. | |
This could be further expanded to do anything you require :) | |
The important thing to remember is that the purpose of these files is | |
to allow you to very easily have your 'project context' (aka 'environment') | |
loaded automatically for you when you enter the project in the shell (cd). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require 'directory_watcher' | |
commands = [ | |
{ :tell => "Firefox", :to => "activate" }, | |
{ :tell => "System Events", :to => "keystroke \"1\" using command down" }, | |
{ :tell => "System Events", :to => "keystroke \"r\" using command down" }, | |
{ :tell => "TextMate", :to => "activate" } | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export RUBY_HEAP_MIN_SLOTS=1000000 | |
export RUBY_HEAP_SLOTS_INCREMENT=250000 | |
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
export RUBY_GC_MALLOC_LIMIT=100000000 | |
export RUBY_HEAP_FREE_MIN=1000000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Notable | |
def self.included(base) | |
base.has_many :notes, :as => :notable | |
base.accepts_nested_attributes_for :notes | |
end | |
end | |
class User < ActiveRecord::Base | |
include Notable | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File permissions | |
run "chmod 755 ." | |
%w(public log tmp).each do |dir| | |
run "chmod -R 755 #{dir}" | |
end | |
# Remove unnecessary files | |
%w(README public/index.html public/favicon.ico public/robots.txt).each do |file| | |
run "rm #{file}" |