Skip to content

Instantly share code, notes, and snippets.


Stephen Reay stephenreay

View GitHub Profile
stephenreay /
Created May 18, 2019
HTTPie mangles input
php -S index.php > php.log 2>&1 &
curl -d foo=bar > curl.out 2>&1
http POST foo=bar > httpie.out 2>&1
stephenreay /
Created Nov 16, 2017
Varnish Repo Key error with GPG
gpg --homedir $(mktemp -d) --no-default-keyring --keyring ./varnish-4.1.gpg --receive-keys FDBCAE9C0FC6FD2E
gpg --homedir $(mktemp -d) --no-default-keyring --keyring ./varnish-5.gpg --receive-keys 40B2721B7DDE60A7
gpg --homedir $(mktemp -d) --no-default-keyring --keyring ./varnish-5.0.gpg --receive-keys 5C9ED2EB63FFACBA
gpg --homedir $(mktemp -d) --no-default-keyring --keyring ./varnish-5.1.gpg --receive-keys F7C76C78895E5551
gpg --homedir $(mktemp -d) --no-default-keyring --keyring ./varnish-5.2.gpg --receive-keys 579BEBB49ADEB60C
stephenreay / Vagrantfile
Created Nov 15, 2017
Webhook PROXY protocol testing
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config| = 'koalephant/debian9-amd64' 'private_network', ip: '' 'private_network', ip: ''
config.vm.define 'webhook-dev'
stephenreay /
Last active Nov 14, 2017
sh vs osh errors
echo "Should work, but doesnt"
printf "%s\n" "Hello World"
/usr/bin/printf "%s\n" "Goodbye Universe"
echo ""
echo "Works"
printf "%s\\n" "Hello World"
/usr/bin/printf "%s\\n" "Goodbye Universe"
stephenreay / Vagrantfile
Last active Jan 9, 2020
Local file override for Memory/CPU limits in Vagrant
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby
if File.exists?('./Vagrantfile.override.rb')
require_relative './Vagrantfile.override.rb'
# Defaults for CPU and Memory
CPUS ||= 1
MEMORY ||= 1024
View multiline param
* @param array $options options for the APCDriver instance. Should be an array with APCDriver::OPT_* constants as the keys
* APCDriver::UNIQUE_PREFIX: `string` - set an application-specific string to prevent collisions in the APC Cache
View test-pdo.php
class T {
private $z;
protected $vars = array();
public function __set($name, $value) {
View bug.php
/* Based on the method below, Autocode produces the wrong docblock. The expected docblock is shown further below */
class Bad {
* Summary
* @param Object array Description
* @param Object array Description
stephenreay / docblock
Created Feb 24, 2012
AutoCode formatting request
View docblock
// Currently
* Summary
* @param {Object} points Description
* @param {Object} i Description
* @returns {Object} Description
// What I'd like
stephenreay / example.js
Created May 31, 2011
Tab-only indenting
View example.js
// Use an indent of 1 tab. Drop anything that breaks a line and indent one full level:
some: value,
another: value