This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function xmlParser(node) { | |
var i = 0; | |
var attrs = node.attributes; | |
var nodes = node.childNodes; | |
var jsNode = new Object(); | |
for(i;i<attrs.length;i++){ | |
jsNode[attrs[i].name] = attrs[i].value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#make sure to run: git config --global color.ui true | |
function parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\*\1/' | |
} | |
case "$TERM" in | |
xterm-*color) color_prompt=yes;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Listens for clicks on a tags, if relative and the target is not blank it will use pushState | |
otherwise we fall through to normal click handling. Note preventDefault might need to be | |
handled better in older browsers. | |
### | |
hijackRelativeURLs = -> | |
document.addEventListener('click', (e) -> | |
element = e.target | |
if element?.nodeName == 'A' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ = require('lodash') | |
class Mixable | |
constructor: -> | |
@initialize() | |
initialize: -> | |
@addToObj: (objectName, dictionary) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function(require) { | |
// forked from https://github.com/tomasAlabes/backbone.raphael | |
'use strict'; | |
function addMixin(mixinOptions) { | |
this.clobber({ | |
setElement: function (element, delegate, undelegateEvents) { | |
if (this.el && undelegateEvents) { | |
this.undelegateEvents(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function(require) { | |
'use strict'; | |
require('stickit'); | |
return function(options){ | |
// NOTE: this assumes inputs | |
var bindingDefaults = { | |
events: ['blur', 'paste', 'change'], | |
onSet: 'onSet' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function(require) { | |
var Backbone = require(‘backbone’), | |
backboneCanvasMixin = require(‘components/shapes/mixins/backbone_raphael_mixin’), | |
isMovable = require(‘components/shapes/mixins/is_movable’) | |
isRotatable = require(‘components/shapes/mixins/is_rotatable’) | |
// … and more ; | |
return Backbone.View.extend({ … }) | |
.mixin(backboneCanvasMixin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--require should | |
--reporter dot | |
--ui bdd | |
--debug | |
--compilers coffee:coffee-react/register | |
--recursive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp = require 'gulp' | |
browserify = require 'gulp-browserify' | |
rename = require 'gulp-rename' | |
gulp.task 'js', -> | |
gulp.src('./public/src/app.coffee', { read: false }) | |
.pipe(browserify({ | |
transform: ['coffee-reactify'], | |
extensions: ['.coffee'], | |
})) |
OlderNewer