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
#!/bin/bash | |
ssh -t [email protected] $1 www ${*:2} |
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
jQuery(function() { | |
// Override rails confirm function | |
$.rails.confirm = function(msg) { return true; } | |
// Unbind any click handlers (optional), create custom handler | |
$('[data-confirm]').unbind('click').click(function(evt){ | |
// Get the target | |
var $target = $(this); | |
// Check if the action has already been confirmed | |
if ($target.data('confirmed') == true) { |
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
namespace :db do | |
desc "Restore latest Heroku db backup locally" | |
task restore: :environment do | |
# Get the current db config | |
config = Rails.configuration.database_configuration[Rails.env] | |
# Get around an issue with the Heroku Toolbelt https://github.com/sstephenson/rbenv/issues/400#issuecomment-18742700 | |
Bundler.with_clean_env do | |
# Download the latest backup to a file called latest.dump in tmp folder | |
`curl -o tmp/latest.dump \`heroku pg:backups public-url -q --remote production\`` | |
# Restore the backup to the current database |