Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am andrewpage on github.
  • I am andrewpage ( on keybase.
  • I have a public key whose fingerprint is ECC3 0E1E A1F0 4D34 90D5 75A5 2CB3 1AC2 B59E 3F5A

To claim this, I am signing this object:

View .vimrc
set nocompatible " be iMproved, required
filetype off " required
" => Plugins
" Auto-install vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
andrewpage / report-passenger.rb
Last active April 12, 2022 22:06
Report Phusion Passenger metrics to AWS CloudWatch.
View report-passenger.rb
#!/usr/bin/env ruby
# Report Instance Count and Request Queue Size metrics from locally running Phusion Passenger instance.
# Author: Andrew Page <>
# ==
# Phusion Passenger:
require 'net/http'
require 'phusion_passenger'
require 'aws-sdk'
controller action user_count
\disruptors/request_for_data"" \index"" 7667
\matches"" \unaccepted"" 7263
\matches"" \show"" 7198
\matches"" \index"" 4015
\progress_reports"" \progress_report"" 3989
\matches"" \proposal"" 3559
\matches"" \lead_type"" 2652
\users"" \show"" 2226
andrewpage / pre-commit.rb
Created October 20, 2015 04:11
Rubocop pre-commit hook
View pre-commit.rb
#!/usr/bin/env ruby
# Grab a list of staged changed files
changed_files = `git diff --name-only HEAD`.split("\n")
should_fail, broken_files = false, []
changed_files.each do |file|
# Run static code analysis on changed file
output = `rubocop #{file} --format simple`
andrewpage / scpt
Created June 18, 2015 00:28
function to scp through a jumphost
View scpt
function scpt {
origin_filename=$(basename $origin)
echo "SCPing '$origin' through jumphost '$jumphost' to destination '$destination'."
cat < $origin | ssh $jumphost "cat > $origin_filename && scp $origin_filename $destination && rm $origin_filename"