Skip to content

Instantly share code, notes, and snippets.

View christophermlne's full-sized avatar

Christopher Milne christophermlne

View GitHub Profile
@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>
@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 / 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 / Wordpress child theme boilerplate
Created August 27, 2013 19:15
Wordpress child theme boilerplate
/*
Theme Name: My Thematic Child Theme
Theme URI:
Description: This is a child theme of thematic created by me
Author: Abbas Suterwala
Author URI:
Template: thematic
Version: 1.0
*/
@christophermlne
christophermlne / WP Database Export
Last active December 22, 2015 05:49
Export wordpress database
mysqldump -u root -proot dbname > filename-$(date '+%Y%m%d-%H-%M').sql
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
@christophermlne
christophermlne / gist:2e646cf1da5e5f3b80be
Created June 9, 2014 15:29
Virtual Box Modern IE networking share localhost
Edit the hosts file: C:\windows\system32\drivers\etc\hosts
(if the hosts folder/file is invisible, select 'all files' from the file type dropdown)
Add this entry:
10.0.2.2 localhost mydomain mydomain.com
You can now refer to the parent machine's vhosts by name!
@christophermlne
christophermlne / file1.txt
Created August 13, 2014 01:56
test of create_gist
test content
@christophermlne
christophermlne / fancy-markup.rb
Created April 30, 2015 13:57
Toronto Ruby Brigate: DSL Workshop Solution, April 29 2015
class FancyMarkup
def initialize
end
def method_missing(name, attr={}, &block)
puts "<#{name}#{self.flatten(attr)}>"
self.instance_eval(&block)
puts "</#{name}>"