brew update
brew install crystal
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
def save_and_open_page | |
dir = "#{Rails.root}/tmp/cache/capybara" | |
file = "#{dir}/#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}.png" | |
FileUtils.mkdir_p dir | |
page.driver.render file | |
wait_until { File.exists?(file) } | |
system "open #{file}" | |
end |
grep -rl "ActiveRecord::Migration" db | xargs sed -i "" "s/ActiveRecord::Migration/ActiveRecord::Migration[5.1]/g"
Add on Heroku add-ons
https://elements.heroku.com/addons/rollbar
Install Gem
Add this line to your application's Gemfile:
gem 'rollbar'
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
curl -X POST -d '{title: "foo", body: "example in makeitreal wow", userId: 1 }' http://jsonplaceholder.typicode.com/posts |
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 'wicked', '~> 1.3' | |
gem 'wicked_pdf', '~> 1.0', '>= 1.0.6' | |
gem 'wkhtmltopdf-binary', '~> 0.12.3' | |
group :production, :staging do | |
gem 'wkhtmltopdf-heroku', '~> 2.12', '>= 2.12.3.0' | |
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
class Array | |
<<-DOC | |
8, 3, -2, -7, -12, ... | |
3 - 8 = -5 | |
-2 - 3 = -5 | |
-7 - (-2) = -5 | |
-12 - (-7) = -5 | |
d = −5. |