In terminal:
heroku addons:add newrelic:standard
Add this gem to your Gemfile: gem 'newrelic_rpm'
module Where | |
class <<self | |
attr_accessor :editor | |
def is_proc(proc) | |
source_location(proc) | |
end | |
def is_method(klass, method_name) | |
source_location(klass.method(method_name)) |
/** | |
* Dead center an image both vertically and horizontally inside | |
* a containing element. | |
* | |
* Notes: | |
* The dead-center container needs height and width set, | |
* and the image to be centered can't exceed those dimenstions. | |
* | |
* Example: | |
* <div class="example dead-center"> |
Get the Heroku db as detailed here: | |
http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup | |
1. heroku pgbackups:capture | |
2. heroku pgbackups:url <backup_num> #=>backup_url | |
- get backup_num with cmd "heroku pgbackups" | |
3. curl -o latest.dump <backup_url> | |
Then locally do: | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump |
class Controller | |
include LazyLoad | |
def show | |
@model = Model.find(...) | |
respond_to do |format| | |
format.html do | |
@html_specific_data = Model.find(...) | |
end |
--colour | |
-I app |
In terminal:
heroku addons:add newrelic:standard
Add this gem to your Gemfile: gem 'newrelic_rpm'
Chances are your head's spinning right now. That accusation of bias caught you off guard, you got kind of defensive, and now all hell has broken loose. You're feeling attacked on all sides. You're a good person at heart, and having all these people treat you like the antichrist is pretty upsetting.
You need to say something, but you're probably not in the best headspace to write copy right now. So to help you along, here's my 100% guaranteed-or-you-money-back scandal defusement apology template:
#!/usr/bin/env ruby | |
def changelog_for_gem(gem) | |
changelogs = `bundle exec gem contents #{gem}`.lines.grep(/history|changelog|news/i) | |
if changelogs.empty? | |
puts "No changelog found for gem #{gem}" | |
return nil | |
end |
$ time script/bootstrap | |
Bundler missing, installing. | |
Fetching: bundler-1.1.3.gem (100%) | |
Successfully installed bundler-1.1.3 | |
1 gem installed | |
Gemfile changed, bundling. | |
Schema changed, updating databases. | |
real 0m9.163s | |
user 0m3.762s |
source :rubygems | |
gem "sinatra", "~> 1.3.2" | |
group :test do | |
gem "minitest", "~> 2.10" | |
gem "rack-test", "~> 0.6.1" | |
gem "capybara", "~> 1.1" | |
gem "capybara-webkit", "~> 0.11" | |
gem "capybara_minitest_spec", "~> 0.2" |