Skip to content

Instantly share code, notes, and snippets.

Avatar

Toby Griffiths toby-griffiths

View GitHub Profile
@toby-griffiths
toby-griffiths / Puppetfile
Last active Nov 2, 2015
Problem npm installing less module for all versions
View Puppetfile
# 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
View LoggerTrait
<?php
namespace CubicMushroom;
use Psr\Log\LoggerInterface;
/**
* Class LoggerTrait
*
* @package LIMTool\PaymentsBundle
@toby-griffiths
toby-griffiths / Unwrapper.php
Last active Oct 13, 2015
Change to clone argument objects
View Unwrapper.php
<?php
class Unwrapper implements RevealerInterface
{
// ...
/**
* @param mixed $argument
*
* @return mixed
@toby-griffiths
toby-griffiths / functions.php
Last active Dec 26, 2015
WordPress - How to redirect a custom post type's single page to a taxonomy page
View functions.php
<?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 Dec 22, 2015
Headers from truncated page
View gist:6412677
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
You can’t perform that action at this time.