Skip to content

Instantly share code, notes, and snippets.

At harbour

John Barton joho

At harbour
View GitHub Profile
joho / gist:3735740
Created Sep 17, 2012 — forked from rafaelss/gist:3700977
PostgreSQL 9.2 upgrade steps
View gist:3735740
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
joho / iam-mfa-password-self-service-policy.json
Created May 6, 2021
IAM policy that allows full IAM self service including MFA
View iam-mfa-password-self-service-policy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "AllowViewAccountInfo",
"Effect": "Allow",
"Action": [
joho /
Created Nov 11, 2014
Script for publishing buildbox build wait times as an AWS cloudwatch metric
# Publishes CloudWatch metrics about Buildbox queue length
set -e
# Determines whether a binary exists on the current $PATH
joho / gzip_net_http.rb
Created Sep 19, 2012
Handling gzip responses in Ruby Net::HTTP library
View gzip_net_http.rb
# from
# i wanted syntax highlighting
require 'net/http'
debug ={|msg| STDERR.puts "[#{'%Y-%m-%d %H:%M:%S')}] #{msg}" }
page = nil
http = "", 80 )
req = "/search?num=20&hl=en&noj=1&q=test&btnG=Search", { "Accept-Encoding" => "gzip", "User-Agent" => "gzip" } )
joho / hecate.yml
Last active Jun 4, 2019
Reference configuration for Hecate Dispatch
View hecate.yml
# Required: an admin contact for errors, billing issues, and the like
# Optional: timezone for when to send and how to format emails
# defaults to "Australia/Melbourne"
timezone: "Australia/Melbourne"
# Required: config for shipping news (notify on merged PRs)
# Array of release notifications to send
joho / hecate.yml
Created May 13, 2019
Hecate team config example
View hecate.yml
timezone: Australia/Melbourne
lead: yourgithublogin
engineers: ["engineerlogin", "engineerlogin"]
owned_repos: ["repo-name", "other-repo-name"]
joho / deploy.rb
Created Sep 13, 2012
How to serve emergency "signed out" views from page cache without affecting signed in users in rails.
View deploy.rb
set :path_to_repo, "/path_to_repo/"
set :running_app_user, "appusername"
namespace :webscale do
desc "Cache a signed out version of the path. Usage: cap webscale:signed_out_cache_page -s path_to_cache=/films/on_netflix"
task :signed_out_cache, roles: :app do
cache_base_path = "#{path_to_repo}/public/signed_out"
cached_destination_path = "#{cache_base_path}#{path_to_cache}.html"
working_path = "#{cached_destination_path}.tmp"
View .env
import _ ""
joho / envato-dev.markdown
Created Oct 24, 2011
Ruby on Rails Developer @ Envato
View envato-dev.markdown

Ruby on Rails Developer @ Envato

Hi, we're Envato and we're looking for Ruby on Rails developers.

Actually, we're just looking for developers. Good developers who either already know a bit of Ruby and/or Rails, or are keen to stretch their skills a bit and learn a new platform. If you're enthusiastic about solving real problem for real users the best way you can, you're probably the kind of developer who would fit right in here.

First though: a bit about us. We're a youngish company, transitioning out of the hectic startup days and into something a bit bigger and more settled. We operate a series of online stock digital media marketplaces such as Activeden (formerly FlashDen), GraphicRiver, ThemeForest, AudioJungle, VideoHive, 3DOcean, CodeCanyon, Tuts+ Marketplace, and PhotoDune.

joho / Makefile
Created Oct 4, 2014
Building and deploying static sites to s3 with
View Makefile
# Variables
# Destroy the final targets
rm -rf $(DIST)/*
# Compile the final targets