Skip to content

Instantly share code, notes, and snippets.

View jdhom's full-sized avatar

John Dhom jdhom

  • bridgeGap consulting
  • USA
View GitHub Profile
@icodeforlove
icodeforlove / each_with_classes.js
Created December 4, 2011 05:43 — forked from burin/each_with_index.coffee
each_with_classes handlebars helper, adds {{item_*}} properties accessible from within the block
/**
* adds an a bunch of item prefixed logic to the object
*
* {{#each_with_classes records prefix="record"}}
* <li class="record_{{item_index}}{{item_position}} {{item_alt}}">{{item_index}}</li>
* {{/each_with_classes}}
*
* results in the following html
*
* <li class="record_0 record_first">0</li>
@burin
burin / each_with_index.coffee
Created June 27, 2011 14:33
each_with_index handlebars helper, adds an {{index}} prop accessible from within the block
Handlebars.registerHelper 'each_with_index', (array, fn) ->
buffer = ''
for i in array
item = i
item.index = _i
buffer += fn(item)
buffer
@matthewmccullough
matthewmccullough / gist:47267
Created January 15, 2009 05:15 — forked from halbtuerke/gist:31934
Show Git dirty status in your Unix bash prompt (symbols not compatible with CygWin)
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"