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 / Gruntfile.js
Created June 23, 2013 18:48
Example of setting up grunt-github-api to get all public assemble repos.
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
// Project metadata
{
"articles": [
{
"title": "Article 1",
"#comments": [
{"subject": "sweet article 1", "body": "that's a really sweet first article" },
{"subject": "re: sweet article 1", "body": "I total agree" }
]
},
{
var helperList = ['a', 'b', 'c', 'd', 'e'];
var documentedList = ['a', 'c'];
var undocumentedList = [];
helperList.forEach(function(helper) {
if(_.contains(documentedList, helper) === false) {
undocumentedList.push(helper);
}
});
@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 / mustache.js
Created December 3, 2012 04:05
mustache grunt task for reading in mustache files and rendering them with data
/*
* build-bootstrap
* https://github.com/jonschlinkert/build-bootstrap
*
* Copyright (c) 2012 Jon Schlinkert
* Credit: inspired by @ctalkington
* Licensed under the MIT license.
*/
module.exports = function(grunt) {
@doowb
doowb / docs.js
Created November 17, 2012 20:54
some component stuff
//
// Build Bootstrap Docs
// ---------------------------------------------
// Credit: inspired by @ctalkington
module.exports = function(grunt) {
// Grunt utilities.
var task = grunt.task,
file = grunt.file,
@doowb
doowb / gist:4064157
Created November 13, 2012 05:37
Client Side Javascript Developer

Looking for a client side javascript developer that can use knockout.js to help build the front end of our application. To show off your skills, we would like the html/css and javascript components of Twitter's Bootstrap library turned into templates that would be useful with knockout.js.

Example alert:

<div data-bind="attr: { class: type }">
  <button type="button" class="close" data-dismiss="alert">×</button>
  <!-- ko data-bind="text: message" -->
  <strong>Warning!</strong> Best check yo self, you're not looking too good.
  <!-- /ko -->
</div>
@doowb
doowb / draft_beerandrobots_white_house_beer_recipe.md
Created September 6, 2012 02:32
Beer and Robots - White House Beer Recipe

White House Beer Recipe

The white house released a couple of homebrew beer recipes along with a video description of why they're doing some homebrewing in The White House. The article, recipes and video can be found here.

I'm going to take the recipe for the White House Honey Porter and pick up the ingredients from my local homebrew supplier, Listermann's and attempt to brew it. Check back for updates with step-by-step documentation on my brewing experience and what I think of the results.

Trip to Listermann's

Brewing the Honey Porter