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 rake(cmd, options={}, &block) | |
command = "cd #{current_path} && bundle exec rake #{cmd}" | |
run(command, options, &block) | |
end | |
$ cap rake 'db:admin:create' |
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
Deface::Override.new(:virtual_path => "products/show", | |
:name => "tweak_thumbs", | |
:replace => "div#main-image", | |
:closing_selector => "div#thumbnails", | |
:text => %q{<span>Hello World</span>}) |
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
['products/show', 'orders/show', 'taxons/show'].each do |virtual_path| | |
Deface::Override.new(:virtual_path => virtual_path, | |
:name => %q{del_accurate_title}, | |
:remove => %q{h1}) | |
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
S3_CREDENTIALS = {:access_key_id => ENV['S3_KEY'], :secret_access_key => ENV['S3_SECRET'], :bucket => ENV['S3_BUCKET']} | |
Image.class_eval do | |
Image.attachment_definitions[:attachment].tap do |a| | |
a[:styles][:large] = '600x350>' | |
a[:styles][:small] = '260x170>' | |
a[:styles][:mini] = '60x60#' | |
a[:styles][:square] = '78x78#' |
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
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path. | |
require "rvm/capistrano" # Load RVM's capistrano plugin. | |
require "bundler/capistrano" | |
load 'deploy/assets' | |
set :application, "YOUR_APP_NAME" | |
set :user, 'spree' | |
set :group, 'www-data' | |
set :domain, "#{application}.spreeworks.com" |
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
//set hook frame positions | |
var show_frames = false; | |
var frame_level = 0; | |
function show_hook_frames(){ | |
$jQ.each($("[data-hook]"), function(i, hook){ | |
$jQ(hook).popover('disable'); | |
}); | |
if(show_frames){ |
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=800000 | |
export RUBY_HEAP_SLOTS_INCREMENT=300000 | |
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
export RUBY_GC_MALLOC_LIMIT=80000000 | |
export RUBY_HEAP_FREE_MIN=100000 |
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
max_connections = 5000 | |
wait_timeout = 600 |
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 connect_to_new(database) | |
klass_name = database.underscore.classify | |
# define class for each database so we get connection pool usage | |
unless (Module.const_get(klass_name) rescue false) | |
klass = Class.new(ActiveRecord::Base) | |
Object.const_set klass_name, klass | |
# only establish connection once | |
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
ruby-1.9.2-p290 :001 > Spree::Product.search({:name_in => "Shirt"}).relation | |
Spree::Product Load (18.3ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."name" IN ('Shirt') | |
=> [] |