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
# | |
# requires 'gem install git' | |
# | |
<% | |
current_branch = Git.open('.').current_branch | |
unless current_branch =~ /(master|rebasing)/ | |
branch = "_#{current_branch}" | |
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
# | |
# This requires the Heroku toolbelt | |
# | |
# Add 'gem install httparty' to your Gemfile | |
# and make sure you have a default Heroku remote setup | |
# in your git config (make sure you can run 'heroku ps' | |
# without specifying an app name. | |
# | |
require 'httparty' |
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
createuser --no-createdb --no-createrole --no-superuser [username] | |
createdb --owner [username] --encoding utf8 [database] | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U [username] -d [database] -p 5432 [data_file] | |
PGUSER=[username] heroku pg:pull HEROKU_POSTGRESQL_NAME [local_database] --app app-name |
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
SELECT schemaname,relname,n_live_tup | |
FROM pg_stat_user_tables | |
ORDER BY n_live_tup DESC; |
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
module Paperclip | |
class Masker < Processor | |
def initialize file, options = {}, attachment = nil | |
super | |
@format = File.extname(@file.path) | |
@basename = File.basename(@file.path, @format) | |
end | |
def make | |
source = @file |