I hereby claim:
- I am mattscilipoti on github.
- I am mattscilipoti (https://keybase.io/mattscilipoti) on keybase.
- I have a public key whose fingerprint is DFD4 1E67 9A6B C312 AA9F 2912 546F C3BA 8673 E21A
To claim this, I am signing this object:
#!/usr/bin/env bash | |
if [ -f "${rvm_path}/scripts/rvm" ]; then | |
source "${rvm_path}/scripts/rvm" | |
# use the config files | |
# .rvmrc supersedes all others | |
if [ -f ".rvmrc" ]; then | |
source ".rvmrc" |
# 1. saves possible branches to file, opens in editor | |
# 2. remove branches you don't want to delete from the list and save. | |
git fetch --prune && git branch --no-color --merged | egrep -v "(^\*|master)" > /tmp/merged-branches && vi /tmp/merged-branches && xargs git branch -d < /tmp/merged-branches |
puts "WARN: We are patching rake tasks to support postgres. You have upgraded Rails and may not need this patch any more (lib/tasks/postgres.rake)." if Rails.version > "3.2.8" | |
namespace :db do | |
desc 'kills connections to postgres db' | |
task :kill_postgres_connections => :environment do | |
env = ENV['RAILS_ENV'] | |
db_config = Rails.configuration.database_configuration[env] | |
fail(ArgumentError, "Could not find db config entry for env (#{env})") unless db_config | |
db_name = db_config['database'] |
# see: http://weblog.therealadam.com/2011/02/12/simple-ruby-pleasures/comment-page-1/#comment-315 | |
class QueryTracer < ActiveSupport::LogSubscriber | |
ACCEPT = %r{^(app|config|lib)}.freeze | |
FRAMES = 5 | |
THRESHOLD = 300 # In ms | |
def sql(event) | |
return unless event.duration > THRESHOLD |
I hereby claim:
To claim this, I am signing this object:
require 'spec_helper' | |
RSpec.describe FactoryGirl do | |
# convention: "base" factories return valid models. | |
# without these tests, factories with invalid associations are difficult to identify and debug | |
# Note: performs build, not create. | |
describe 'all factories,' do | |
factories_to_skip = {} |
#!/usr/bin/env ruby | |
# NOTE! this is a work in progress. This is not tested or used regularly. | |
# Ensures we do not call destructive commands on protected branches. | |
# | |
# Called by "git push" after it has checked the remote status, | |
# but before anything has been pushed. | |
# | |
# If this script exits with a non-zero status nothing will be pushed. |
db_tasks = %w[db:migrate db:migrate:up db:migrate:down db:rollback db:seed db:version] # db:forward] | |
namespace :multitenant do | |
desc 'List all existing tenants/customers' | |
task :list => :environment do | |
puts Customer.all.collect &:name | |
end | |
#create a multitenant task for each db task | |
db_tasks.each do |task_name| |