This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'rbosa' | |
account='xxx' | |
username='xxx' | |
password='xxx' | |
api="https://#{account}.presentlyapp.com/api/twitter/statuses/update.xml" | |
itunes = OSA.app("iTunes") |
This file contains 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
# you'd obviously have more settings somewhere | |
set :scm, :git | |
set :repository, "git@github.com:defunkt/github.git" | |
set :branch, "origin/master" | |
set :migrate_target, :current # this tells capistrano where to run the migration. otherwise it would try to use the latest release directory (/path/to/app/releases/2012XXXXXXXXX) | |
set :use_sudo, false | |
set :ssh_options, {:forward_agent => true} # so you can checkout the git repo without giving the server access to the repo | |
set :rails_env, 'production' | |
# These are here to override the defaults by cap |
This file contains 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
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
# 16 workers and 1 master | |
worker_processes (rails_env == 'production' ? 16 : 4) | |
# Load rails+github.git into the master before forking workers | |
# for super-fast worker spawn times | |
preload_app true |
This file contains 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
# NewRelic instrumentation for ThinkingSphinx | |
if defined? ActiveRecord | |
ActiveRecord::Base.class_eval do | |
class << self | |
add_method_tracer :search, 'ActiveRecord/#{self.name}/search' | |
add_method_tracer :search, 'ActiveRecord/search', :push_scope => false | |
add_method_tracer :search, 'ActiveRecord/all', :push_scope => false | |
add_method_tracer :search_count, 'ActiveRecord/#{self.name}/search_count' | |
add_method_tracer :search_count, 'ActiveRecord/search_count', :push_scope => false |
This file contains 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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'tinder' | |
load "#{ENV['HOME']}/.campfire_status" | |
msg = "[#{USER_NAME} @ #{Time.now.strftime('%I:%M%p')}] #{ARGV.join(' ')}" | |
campfire = Tinder::Campfire.new(CAMPFIRE_SITE) | |
campfire.login(CAMPFIRE_EMAIL, CAMPFIRE_PASSWORD) |
This file contains 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
# on Start | |
do shell script "~/bin/set_campfire_status.rb \"Starting Pomodoro '$pomodoroName'\"" | |
# on End | |
do shell script "~/bin/set_campfire_status.rb \"Pomodoro '$pomodoroName' ended\"" | |
# on Reset | |
do shell script "~/bin/set_campfire_status.rb \"Pomodoro '$pomodoroName' ended (reset)\"" |
This file contains 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
# install git | |
# install heroku ruby gem | |
# now, clone the github_twitter_server project | |
git clone git://github.com/technoweenie/github_twitter_server.git | |
cd github_twitter_server | |
# create a free heroku app | |
heroku create USER-gh-twitter |
This file contains 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
# Have to use ActiveRecord so that New Relic shows it on all graphs. | |
# The push scope false stuff makes it so that you can track usage by model and overall. | |
if defined?(NewRelic) | |
module MongoMapperNewRelic | |
def self.included(model) | |
mm_class_methods = [ | |
:find, | |
:find!, | |
:paginate, | |
:first, |
This file contains 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
# Hook our MongoMapper model into Solr | |
module MongoAdapter | |
class InstanceAdapter < Sunspot::Adapters::InstanceAdapter | |
def id | |
@instance.id | |
end | |
end | |
class DataAccessor < Sunspot::Adapters::DataAccessor | |
def load(id) |
This file contains 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 "resque" | |
require "resque/failure/multiple" | |
require "resque/failure/redis" | |
# Configure Resque connection from config/redis.yml. This file should look | |
# something like: | |
# development: localhost:6379 | |
# test: localhost:6379:15 | |
# production: localhost:6379 | |
Resque.redis = YAML.load_file(Rails.root + 'config/redis.yml')[Rails.env] |
OlderNewer