git branch | grep -v "master\|testing\|staging" | xargs git branch -D
more information: https://coderwall.com/p/x3jmig/remove-all-your-local-git-branches-but-keep-master
template = ERB.new(@template) | |
template.def_method(LayoutRenderer, 'render') | |
result = LayoutRenderer.new.render do | |
ERB.new(@content).result(binding) | |
end | |
File.open('tmp/payslip_filename.html', 'w+') do |f| | |
f.write result | |
end |
git branch | grep -v "master\|testing\|staging" | xargs git branch -D
more information: https://coderwall.com/p/x3jmig/remove-all-your-local-git-branches-but-keep-master
brew update
brew install crystal
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'
curl -X POST -d '{title: "foo", body: "example in makeitreal wow", userId: 1 }' http://jsonplaceholder.typicode.com/posts |