Skip to content

Instantly share code, notes, and snippets.

View kitgrose's full-sized avatar

Kit Grose kitgrose

View GitHub Profile
@kitgrose
kitgrose / balanced-columns.php
Created January 9, 2014 06:38
Makes n balanced lists of grouped items in PHP, without breaking up any groups in the initial set and while preserving the order of sets. Useful for taking a grouped set of navigation items and presenting them in columns in a navigation menu.
<?php
/*
Makes n balanced lists of sub-lists, without breaking inside any existing lists.
Expects input in the form:
array(
'Section 1' => array(
'Item',
'Item',
@kitgrose
kitgrose / webkit-bug.html
Created December 11, 2012 08:58
Weird WebKit CSS bug
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
tr > * {
padding: 1em;
}
tr:nth-child(even) td {
background-color: red;
@kitgrose
kitgrose / gist:1745011
Created February 5, 2012 12:01 — forked from xerxesb/gist:1744913
Netbank hackery
var BetterNetbank = {
inject: function(table) {
if ($("#" + table).length > 0) {
$('#' + table + ' thead tr').prepend('<th>X</th>');
$('#' + table + 'Body > tr').map(function() {
$(this).prepend('<td><input type="checkbox" /></td>');
});
}
}
}