Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ ! -z "$1" ]; then
if [ ! -d "$1" ]; then
mkdir "$1"
mkdir "$1/bin"
mkdir "$1/docs"
mkdir "$1/tests"
mkdir "$1/$1"
touch "$1/README.md"
@cmattoon
cmattoon / FontAwesome Content Grabber
Created March 7, 2014 15:13
Script to pull FontAwesome "content" values.
var icons = {};
var ignore = ['fa-lg', 'fa-fw', 'fa'];
$('.container i.fa').each(function() {
var val, icon_name, icon_value, i;
val = window.getComputedStyle($(this).get(0), ':before').getPropertyValue('content');
icon_name = $(this).attr('class').split(' ')[1];
console.log(icon_name);
charcode = val.charCodeAt(0).toString(16);
icons[icon_name] = charcode;
@cmattoon
cmattoon / FontAwesome SASS-SCSS Variable List
Created March 7, 2014 15:11
FontAwesome SASS-SCSS Variable Declarations
/* FontAwesome Variable List
*
* Usage:
* .input.username {
* &:before {
* font-family: $icon-font;
* content: $fa-user;
* }
* }
*/
@cmattoon
cmattoon / jsRespond
Created August 28, 2013 19:42
Simple function to call JavaScript functions based on window.innerWidth Usage: jsRespond(max_width, callback) or jsRespond(min_width,max_width,callback)
function jsRespond() {
var min_width, max_width, callback,arglen,width;
arglen = arguments.length;
width = window.innerWidth;
if (arglen == 2) {
min_width = 0;
max_width = arguments[0];
callback = arguments[1];
} else if (arglen == 3) {
@cmattoon
cmattoon / gist:6241862
Created August 15, 2013 15:38
Update Google Analytics when browser orientation changes.
function checkOrientation() {
var w,o,t;
w = window;
o = (w.innerWidth > w.innerHeight) ? 'landscape' : 'portrait';
t = _gat._getTrackers()[0];
if (typeof(w.gao) == 'undefined') {
w.gao = o;
} else {
if (w.gao != o) {