Skip to content

Instantly share code, notes, and snippets.

View christophermlne's full-sized avatar

Christopher Milne christophermlne

View GitHub Profile
@christophermlne
christophermlne / Interactive nested lists pattern
Created August 23, 2013 13:54
Basic code to enable a nested ul structure to be open and closed at any level by the user
$('h3').click(function(){
var t = $(this);
if (t.hasClass('open')) {
t.removeClass('open');
t.siblings('ul').hide();
} else {
t.addClass('open');
t.siblings('ul').show();
};
});
@christophermlne
christophermlne / error_reporting.php
Created May 23, 2013 18:31
Enable php error reporting. Overrides server .ini settings
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
@christophermlne
christophermlne / pretty-prease.sublime-snippet
Last active December 15, 2015 15:29
A Sublime Text snippet that wraps a print_r with pre tags. A tab stop highlights the $var inside the print_r function. The tabTrigger is 'ppre' within the php scope.
<snippet>
<content><![CDATA[
print '<pre>';
print_r(${1:var});
print '</pre>';
]]></content>
<tabTrigger>ppre</tabTrigger>
<scope>source.php</scope>
</snippet>