Skip to content

Instantly share code, notes, and snippets.

View uxjw's full-sized avatar

James Wilcox uxjw

  • Primal Communications Ltd.
  • BC, Canada
View GitHub Profile
@uxjw
uxjw / _breakpoints.scss
Last active August 29, 2015 14:20
SCSS Breakpoints Mixin
/**
* Breakpoint mixins
*/
$breakpoints: (
mobile: ( min: 300px, max: 479px ),
mobile_ls: ( min: 480px, max: 759px ),
tablet: ( min: 760px, max: 1023px ),
tablet_ls: ( min: 1024px, max: 1279px ),
laptop: ( min: 1280px, max: 1499px ),
@uxjw
uxjw / tree.php
Last active August 29, 2015 14:20
PHP Associative array to tree
<?php
// Converts an array of single rows with a parent id column into a tree
function tree($rows){
// supplied array must be indexed by row id
$tree = array(); //stores the tree
$tree_index = array(); //an array used to quickly find nodes in the tree
$id_column = "id"; //The column that contains the id of each node
$parent_column = "parent"; //The column that contains the id of each node's parent
@uxjw
uxjw / gitlg.sh
Last active August 29, 2015 14:20
Git lg alias - log skin
# https://coderwall.com/p/euwpig/a-better-git-log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"