Skip to content

Instantly share code, notes, and snippets.

View indieisaconcept's full-sized avatar

Jonathan Barnett indieisaconcept

View GitHub Profile
@indieisaconcept
indieisaconcept / gist:21261cd9c7ff04be4447
Last active August 29, 2015 14:10
Mocking node.js dependies
var proxyquire = require('proxyquire').noPreserveCache(),
leche = require('leche'),
sinon = require('sinon'),
npath = require('path'),
_ = require('lodash');
/**
* @ngdoc function
* @name proxy
*
@indieisaconcept
indieisaconcept / grunt-styleguide.js
Last active October 11, 2015 22:48
Example task configuration for grunt-styleguide
styleguide: {
styledocco: {
options: {
framework: {
name: 'styledocco'
},
@indieisaconcept
indieisaconcept / gist:3964678
Created October 27, 2012 13:50
Load multiple grunt plugins by reading package.json
var loadPackageTasks = function (/* String */ prefix, /* Array */ tasks) {
prefix = prefix || 'grunt-';
tasks = tasks || grunt.file.readJSON('package.json') || [];
var prefixLen = prefix.length;
if (_.isObject(tasks)) {
tasks = tasks.devDependencies || tasks;
tasks = Object.keys(tasks);
@indieisaconcept
indieisaconcept / gist:4016862
Created November 5, 2012 11:59
Grunt helpers for when using grunt-hub
var JSON5 = require('json5'),
path = require('path'),
fs = require('fs'),
existsSync = fs.existsSync || path.existsSync;
exports.init = function (grunt) {
'use strict';
grunt.util = grunt.util || grunt.utils;
@indieisaconcept
indieisaconcept / gist:4116869
Created November 20, 2012 09:08
Example madge output
{
"application/analytics/bootstrap": [
"analytic/google",
"analytic/native",
"config",
"underscore",
"util/log",
"util/pubsub"
],
"application/analytics/tracker/google": [
@indieisaconcept
indieisaconcept / SassMeister-input-HTML.html
Created December 11, 2013 12:18
Example of variable inheritance using .scss and guarded assignment
<div class="box"></div>
@indieisaconcept
indieisaconcept / SassMeister-input-HTML.html
Created December 11, 2013 12:34
Example of variable overrides with .scss, highlighting that variables are not emuatable
<div class="box"></div>
@indieisaconcept
indieisaconcept / SassMeister-input-HTML.html
Created December 11, 2013 13:53
Example of how not namespacing your variables can cause problems
<p>This is an example of a how you need to be careful with variable naming and use.</p>
<div class="box">BOX</div>
@indieisaconcept
indieisaconcept / SassMeister-input-HTML.html
Created December 11, 2013 14:04
Example of how not namespacing your variables can make it easier to maintain
<div class="module">
<p>This is an example of using namespaced variables</p>
</div>
<div class="box">BOX</div>
@indieisaconcept
indieisaconcept / SassMeister-input-HTML.html
Created December 11, 2013 23:57
Example of the wrong way of using variables with lists to display accent colors
<div class="news">
<div class="module-header">news</div>
</div>
<div class="sport">
<div class="module-header">sport</div>
</div>
<div class="business">
<div class="module-header">business</div>