Skip to content

Instantly share code, notes, and snippets.

View cwaring's full-sized avatar

Chris Waring cwaring

View GitHub Profile
@cwaring
cwaring / gist:1002359
Created June 1, 2011 14:11
jQuery TOC from .section > h2
var items = new Array;
var ul = $('<ul />');
$('.section h2:first-child').each(function(e) {
items.push(this);
});
$.each(items, function(i, item) {
var $item = $(this),
@cwaring
cwaring / gist:974262
Created May 16, 2011 11:20
Stylus color mixing mixin
/**
* Colour mixer: mix source with a target colour by a % value
*/
mix(source, target, ammount)
ammount = unit(ammount, '%')
unless source is a 'rgba' and target is a 'rgba'
error('mix() expects rgb colour values')
ctags --langmap=php:.engine.inc.module.theme.php --php-kinds=cdfi --languages=php --recurse \
--exclude="\.git" \
--totals=yes \
--tag-relative=yes \
--regex-PHP='/abstract\s+class\s+([^ ]+)/\1/c/' \
--regex-PHP='/interface\s+([^ ]+)/\1/c/' \
--regex-PHP='/(public\s+|static\s+|abstract\s+|protected\s+|private\s+)function\s+\&?\s*([^ (]+)/\2/f/'