Skip to content

Instantly share code, notes, and snippets.

View toby-griffiths's full-sized avatar

Toby Griffiths toby-griffiths

View GitHub Profile
@toby-griffiths
toby-griffiths / Puppetfile
Last active November 2, 2015 12:14
Problem npm installing less module for all versions
# This file manages Puppet module dependencies.
#
# It works a lot like Bundler. We provide some core modules by
# default. This ensures at least the ability to construct a basic
# environment.
# Shortcut for a module from GitHub's boxen organization
def github(name, *args)
options ||= if args.last.is_a? Hash
args.last
@toby-griffiths
toby-griffiths / LoggerTrait
Created October 19, 2015 15:22
PSR-3 Logger trait
<?php
namespace CubicMushroom;
use Psr\Log\LoggerInterface;
/**
* Class LoggerTrait
*
* @package LIMTool\PaymentsBundle
@toby-griffiths
toby-griffiths / Unwrapper.php
Last active October 13, 2015 12:09
Change to clone argument objects
<?php
class Unwrapper implements RevealerInterface
{
// ...
/**
* @param mixed $argument
*
* @return mixed
@toby-griffiths
toby-griffiths / functions.php
Last active December 26, 2015 07:59
WordPress - How to redirect a custom post type's single page to a taxonomy page
<?php
function wp9899234_parse_query() {
if ( is_admin() || is_single() || '<post_slug>' !== get_post_type() ) {
return;
}
// Work out taxonomy page
// $tax_permalink = ...?
@toby-griffiths
toby-griffiths / gist:6412677
Last active December 22, 2015 03:49
Headers from truncated page
Response Headers...
HTTP/1.1 200 OK
Date: Mon, 02 Sep 2013 13:05:18 GMT
Server: Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_bwlimited/1.4
X-Powered-By: PHP/5.3.24
Set-Cookie: CAKEPHP=da7201fcaa62baba2f7c1b21684b05df; expires=Mon, 02-Sep-2013 17:05:18 GMT; path=/; HttpOnly
Content-Length: 2458
Connection: close
Content-Type: text/html; charset=UTF-8