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
# More info at https://github.com/guard/guard#readme | |
guard 'spork', :cucumber => false, :test_unit => false, :rspec_env => { 'RAILS_ENV' => 'test' } do | |
watch('config/application.rb') | |
watch('config/environment.rb') | |
watch(%r{^config/environments/.+\.rb$}) | |
watch(%r{^config/initializers/.+\.rb$}) | |
watch('spec/spec_helper.rb') | |
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
# add to config/initializers | |
if hostname =~ /qa/ || Rails.env.staging? | |
class OverrideMailRecipient | |
def self.delivering_email(mail) | |
mail.to = "[email protected]" | |
end | |
end | |
ActionMailer::Base.register_interceptor(OverrideMailRecipient) | |
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
# generate profile around a script/test | |
$ CPUPROFILE=/tmp/my_app_profile RUBYOPT="-r`gem which perftools | tail -1`" ruby -I spec spec/models/user_role_spec.rb | |
# generate profile using a block | |
# (this is in ruby obviously) | |
require 'perftools' | |
PerfTools::CpuProfiler.start("/tmp/add_numbers_profile") do | |
5_000_000.times{ 1+2+3+4+5 } | |
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
/* method taken from http://pictos.cc/articles/using-icon-fonts/ */ | |
[data-icon]:before { | |
font-family: 'IcoMoonRegular'; | |
content: attr(data-icon); | |
-webkit-font-smoothing: antialiased; | |
} | |
.icon { | |
strong { | |
text-indent: -99999px; |
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
# backup current production db | |
$ heroku pgbackups:capture --app myapp-production | |
# restore to staging | |
$ heroku pgbackups:restore DATABASE `heroku pgbackups:url --app myapp` --app myapp-staging |
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
## add new staging server locally that someone else created ## | |
# make sure you're a collaborator on the app | |
heroku apps | |
# assuming you already have directory cloned, if not clone it. | |
git remote add app2 [email protected]:app2.git | |
# deploy master | |
git push app2 |
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 install ruby-freshbooks | |
# https://github.com/elucid/ruby-freshbooks | |
# | |
# * Limitations * | |
# - Freshbooks Invoice #'s can only be 10 characters | |
# - requires creating clients ahead of time (though this would be easy for someone to add) | |
# - client names must match exactly | |
# | |
# * Usage * | |
# require 'freshbooks_importer' |
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
gunzip productionlog.gz | |
# if 63 changes in the future, you want to cut from the first char in date -> rails | |
cat productionlog.log | cut -c 63- | grep 'rails\[' > log/production-oink.log | |
oink --threshold=0 log/production-oink.log |
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
get 'some/path/to/app/*', to: 'controller#action_that_uses_template_with_ember_stuff' | |
# user requests some/path/to/app/cool/path | |
# ember should see cool/path |
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
{ | |
"survey":{ | |
"id":4, | |
"name":"Cool Survey", | |
"instructions": null, | |
"question_ids": [48,49] | |
} | |
} |
OlderNewer