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
# Gem: http://rubygems.org/gems/devil | |
# Library: http://openil.sourceforge.net/ | |
# Images for use with this: http://dl.dropbox.com/u/363740/images.zip | |
# To install on snow leopard with homebrew: | |
# 1. brew install devil | |
# 2. gem install devil | |
# 3. ??? | |
# 4. Profit! |
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
================================================================ | |
= Trusting an .rvmrc file means that whenever you cd into this = | |
= directory, RVM will run this .rvmrc script in your shell. = | |
= = | |
= If the contents of the file change, you will be re-prompted = | |
= to review the file and adjust its trust settings. You may = | |
= also change the trust settings manually at any time with = | |
= the 'rvm rvmrc' command. = | |
= = | |
= Now that you have examined the contents of the file, do you = |
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
Helpers.updateResizeInput = function(el, text){ | |
if(el.localName == "input" || el[0].localName == "input"){ // inputs are a pain | |
el.parent().prepend('<span id="test" />'); | |
var theSpan = $('span#test', el.parent()); | |
theSpan.value = text; | |
Helpers.updateResizeInput(theSpan, text); | |
el.css('font-size', theSpan.css('font-size')); | |
el.css('margin-top', theSpan.css('margin-top')); | |
el[0].value = text; | |
theSpan.remove(); |
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 'steak' | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'rack/test' | |
RSpec.configure do |config| | |
def app | |
Capybara.app | |
end | |
config.include Capybara |
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
Before do | |
Capybara.default_host = 'example.com' | |
DatabaseCleaner.start | |
end | |
After do | |
DatabaseCleaner.clean | |
FileUtils.rm_r(Dir.glob("#{Rails.root}/tmp/uploads/*")) | |
FileUtils.rm_r(Dir.glob("#{Rails.root}/uploads/test*")) | |
FileUtils.rm_r(Dir.glob("#{Rails.root}/public/uploads/tmp/*")) |
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
# Postgres backup script | |
# mynameisrufus | |
# | |
# Cron tab examples: | |
# | |
# daily keeping the last 5 days (run at 1:00AM, 2 minutes after the hour) | |
# | |
# 02 1 * * * postgres /script/db_backup.sh daily /var/backups/db $DATABASE_OWNER 5 >> /var/backups/db/backup.log 2>&1 | |
# | |
# |
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
## This is just mangled out of the resque repo | |
check process resque with pidfile /path/to/pidfile.pid | |
start program = "/bin/sh -c 'cd /path/to/app/current; /usr/bin/env RAILS_ENV=production /usr/bin/env QUEUE="*" VERBOSE=1 /usr/bin/rake environment resque:work & > log/resque.log && echo $! > tmp/pids/resque.pid'" as uid rails and gid rails | |
stop program = "/bin/sh -c 'cd /path/to/app/current && kill -s QUIT `cat tmp/pids/resque.pid` && rm -f tmp/pids/resque.pid; exit 0;'" | |
if totalmem is greater than 100 MB for 10 cycles then restart # eating up memory? | |
group resque_workers |
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
⚡ rake spec | |
rake aborted! | |
dlsym(0x1027f1510, Init_libxml_ruby): symbol not found - /Users/chris/.rvm/gems/ruby-1.8.7-p330/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle |
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
class KlassB | |
def do_something | |
save | |
send email or some such thing | |
end | |
end |
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
.input | |
= f.text_area :body | |
= f.hidden_field :commented_by, :value => current_user.email |