start new:
tmux
start new with session name:
tmux new -s myname
after "deploy:stop", "clockwork:stop" | |
after "deploy:start", "clockwork:start" | |
after "deploy:restart", "clockwork:restart" | |
namespace :clockwork do | |
desc "Stop clockwork" | |
task :stop, :roles => clockwork_roles, :on_error => :continue, :on_no_matching_servers => :continue do | |
run "if [ -d #{current_path} ] && [ -f #{pid_file} ]; then cd #{current_path} && kill -INT `cat #{pid | |
_file}` ; fi" | |
end |
::Redis::Client.class_eval do | |
# Support older versions of Redis::Client that used the method | |
# +raw_call_command+. | |
call_method = ::Redis::Client.new.respond_to?(:call) ? :call : :raw_call_command | |
def call_with_stats_trace(*args, &blk) | |
method_name = args[0].is_a?(Array) ? args[0][0] : args[0] | |
start = Time.now | |
begin |
/* ---------------------------------------------------------- */ | |
/* */ | |
/* A media query that captures: */ | |
/* */ | |
/* - Retina iOS devices */ | |
/* - Retina Macs running Safari */ | |
/* - High DPI Windows PCs running IE 8 and above */ | |
/* - Low DPI Windows PCs running IE, zoomed in */ | |
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */ | |
/* - Android hdpi devices and above */ |
# Save some data when a feature failed | |
After('@javascript') do |scenario| | |
# Only failed, and only if we can render | |
if scenario.failed? && page.driver.respond_to?(:render) | |
# Get a name | |
name = case scenario | |
when Cucumber::Ast::OutlineTable::ExampleRow | |
[ scenario.scenario_outline.name, scenario.name ].join(' ') |
function CustomError () { | |
this.message = "Custom error, yay!"; | |
}; | |
CustomError.prototype = Error.prototype; | |
throw new CustomError(); |
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL | |
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew | |
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers | |
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it | |
gem install bundler | |
# 1. Get edge Rails source (master branch) | |
git clone https://github.com/rails/rails.git |
module CertoPay | |
module ActiveRecord | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def validate_further(*args, &block) | |
options = args.extract_options! | |
options = options.dup | |
options[:if] = Array.wrap(options[:if]) |
by Jonathan Rochkind, http://bibwild.wordpress.com
Capistrano automates pushing out a new version of your application to a deployment location.
I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.