Skip to content

Instantly share code, notes, and snippets.

Stephen Reay stephenreay

Block or report user

Report or block stephenreay

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
@stephenreay
stephenreay / commands.sh
Created May 18, 2019
HTTPie mangles input
View commands.sh
php -S 127.0.0.1:8888 index.php > php.log 2>&1 &
curl 127.0.0.1:8888 -d foo=bar > curl.out 2>&1
http POST 127.0.0.1:8888 foo=bar > httpie.out 2>&1
@stephenreay
stephenreay / v.sh
Created Nov 16, 2017
Varnish Repo Key error with GPG
View v.sh
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
stephenreay / Vagrantfile
Created Nov 15, 2017
Webhook PROXY protocol testing
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = 'koalephant/debian9-amd64'
config.vm.network 'private_network', ip: '192.168.98.5'
config.vm.network 'private_network', ip: '192.168.99.5'
config.vm.define 'webhook-dev'
@stephenreay
stephenreay / printf-test.sh
Last active Nov 14, 2017
sh vs osh errors
View printf-test.sh
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
stephenreay / Vagrantfile
Last active Apr 23, 2018
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'
end
# 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
<?php
error_reporting(-1);
class T {
private $z;
protected $vars = array();
public function __set($name, $value) {
View bug.php
<?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
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
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:
SomeObject
.myMethod().chain1()
.chain2().chain3();
SomeObject.myMethod({
some: value,
another: value
You can’t perform that action at this time.