Skip to content

Instantly share code, notes, and snippets.

View doowb's full-sized avatar
:octocat:
Creating something awesome!

Brian Woodward doowb

:octocat:
Creating something awesome!
View GitHub Profile
# Usage: {{ include [partial] }}
module.exports.include = include = (template, options) ->
partial = Handlebars.partials[template]
if (typeof partial is "string")
partial = Handlebars.compile(partial)
Handlebars.partials[template] = partial
return Utils.safeString('Partial **' + template + '** not found.') unless partial
context = _.extend({}, this, options.hash)
Utils.safeString partial(context)
assembleOptions = options #this is assuming these helpers are in the register function that takes in an options object from assemble
minimatch = require 'minimatch'
matchPartials = (src, search) ->
files = grunt.files.expand src
partials = files.filter(minimatch.filter(search))
partials
@doowb
doowb / gist:5456988
Last active December 16, 2015 15:39 — forked from dmarr/gist:5456766
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
@doowb
doowb / data-markdown.js
Created September 5, 2012 01:26 — forked from paulirish/data-markdown.user.js
*[data-markdown] - use markdown, sometimes, in your HTML
(function boom(){
if (!window.Showdown){
var scr = document.createElement('script');
scr.onload = boom;
scr.src = 'https://raw.github.com/github/github-flavored-markdown/gh-pages/scripts/showdown.js';
document.body.appendChild(scr);
return;
}