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/sh | |
# | |
# ******************************************* | |
# WARNING: this does *not* handle 3-way merges properly. | |
# Anything modified on the local branch since the common base will get ignored. | |
# | |
# FOR ANYONE LANDING HERE: | |
# This script is now updated as part of the git-whistles gem. | |
# https://github.com/mezis/git-whistles | |
# ******************************************* |
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 id,state,command,time,left(replace(info,'\n','<lf>'),120) | |
FROM information_schema.processlist | |
WHERE command <> 'Sleep' | |
AND info NOT LIKE '%PROCESSLIST%' | |
ORDER BY time DESC LIMIT 50; |
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
-- | |
-- PostgreSQL memory usage | |
-- Requires the pg_buffercache extension | |
-- | |
SELECT | |
n.nspname, c.relkind, c.relname, | |
COUNT(1) AS buffers, | |
-- (100 * COUNT(1) * 8192.0 / pg_table_size(c.oid))::INT AS pct_cached, | |
RPAD(LPAD('', (COUNT(1) * 8192e1 / pg_table_size(c.oid))::INT, '█'), 10, '░') AS pct_cached, |
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 | |
# | |
# List branch status and age against an integration branch. | |
# | |
# Copyright (C) 2012 Julien Letessier | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
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 | |
# | |
# Close a feature branch - removing it from local and remote. | |
# | |
die() { | |
echo "$@" ; exit 1 | |
} | |
head=$(git symbolic-ref HEAD 2> /dev/null || git log -1 --format=%h) |
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
#!/usr/bin/env ruby | |
puts "Press RETURN when the geocoder cache has been unpacked in tmp/cache/geocoder" | |
gets | |
Geocoder.config[:cache] = ActiveSupport::Cache::FileStore.new('tmp/cache/geocoder') | |
puts "Paste the correct Google API key:" | |
Geocoder.config[:api_key] = gets.strip | |
BackfillUserCityAreaService.new.run |
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
Encode | |
====== | |
Date: August 22, 2016 | |
System Information | |
------------------ | |
Operating System: OS X 10.11.6 (15G31) | |
CPU: Intel Core i7 2.5 GHz | |
Processor Count: | |
Memory: 16 GB |
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 TunesFillfactor < ActiveRecord::Migration | |
TABLES = %w[orders restaurant_assignment order_assignment order_item driver zone_metrics] | |
def up | |
TABLES.each do |table| | |
execute %{ALTER TABLE #{table} SET (fillfactor = 85)} | |
end | |
end | |
def down |
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
diff --git i/config/deploy.rb w/config/deploy.rb | |
index 73fc910..594322c 100644 | |
--- i/config/deploy.rb | |
+++ w/config/deploy.rb | |
@@ -65,7 +65,7 @@ end | |
desc 'restart' | |
deploy.task :restart, :roles => :web do | |
- run "touch #{current_path}/tmp/restart.txt" | |
+ run "bash -c 'sleep $(( $RANDOM / 100 ))' ; date ; touch #{current_path}/tmp/restart.txt" |
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
#!/usr/bin/env ruby | |
# | |
# Heroku wrapper | |
# | |
require 'pathname' | |
app_basename = Pathname.new('.').realpath.basename.to_s | |
head_name = %x(git symbolic-ref HEAD).strip | |
branch_name = head_name.gsub(%r(^refs/heads/), '') |
NewerOlder