Skip to content

Instantly share code, notes, and snippets.

Andrew Page andrewpage

Block or report user

Report or block andrewpage

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am andrewpage on github.
  • I am andrewpage (https://keybase.io/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
andrewpage / report-passenger.rb
Last active Jan 30, 2018
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 <andrew@andrewpage.me>
# ==
# Phusion Passenger: https://www.phusionpassenger.com
require 'net/http'
require 'phusion_passenger'
require 'aws-sdk'
View Results.md
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
andrewpage / pre-commit.rb
Created Oct 20, 2015
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
andrewpage / scpt
Created Jun 18, 2015
function to scp through a jumphost
View scpt
function scpt {
origin=$1
origin_filename=$(basename $origin)
jumphost=$2
destination=$3
echo "SCPing '$origin' through jumphost '$jumphost' to destination '$destination'."
cat < $origin | ssh $jumphost "cat > $origin_filename && scp $origin_filename $destination && rm $origin_filename"
You can’t perform that action at this time.