Skip to content

Instantly share code, notes, and snippets.

View stephenreay's full-sized avatar

Stephen Reay stephenreay

View GitHub Profile
@stephenreay
stephenreay / example.js
Created May 31, 2011 00:26
Tab-only indenting
// 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
@stephenreay
stephenreay / docblock
Created February 24, 2012 04:50
AutoCode formatting request
// Currently
/**
* Summary
* @param {Object} points Description
* @param {Object} i Description
* @returns {Object} Description
*/
// What I'd like
@stephenreay
stephenreay / bug.php
Created February 24, 2012 04:59
Autocode 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
<?php
error_reporting(-1);
class T {
private $z;
protected $vars = array();
public function __set($name, $value) {
* @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
@stephenreay
stephenreay / Vagrantfile
Last active January 9, 2020 13:44
Local file override for Memory/CPU limits in Vagrant
# -*- 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
@stephenreay
stephenreay / printf-test.sh
Last active November 14, 2017 20:07
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
stephenreay / Vagrantfile
Created November 15, 2017 16:22
Webhook PROXY protocol testing
# -*- 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 / v.sh
Created November 16, 2017 09:58
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
stephenreay / commands.sh
Created May 18, 2019 09:16
HTTPie mangles input
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