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 (require, exports) -> | |
$ = require 'jquery' | |
exports.queued = (func) -> | |
q = $({}) | |
wrapper = -> | |
args = arguments | |
q.queue (next) => | |
func.apply(this, args).then(next, next) |
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
COFFEE = $(shell find coffee -name '*.coffee' -type f) | |
JS = $(COFFEE:coffee/%.coffee=js/%.js) | |
SASS = $(shell find sass -name '*.sass' -type f) | |
all: js css | |
watch: | |
watch -n1 $(MAKE) |
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
class exports.Behaviour extends View | |
setElement: -> | |
this.$el.removeClass(this.className) if this.className? | |
super | |
remove: -> | |
this.$el.removeClass(this.className) if this.className? | |
this.undelegateEvents() | |
this.stopListening() |
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
// js | |
var handlers = require('handlers'); | |
var impls = handlers.impls; | |
var impl = handlers.impl; | |
var ret = handlers.ret; | |
// coffee | |
{impls, impl, ret} = require 'handlers' | |
WTF?! |
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
BIN = ./node_modules/.bin | |
SRC = $(wildcard src/*.coffee) | |
LIB = $(SRC:src/%.coffee=lib/%.js) | |
build: $(LIB) | |
lib/%.js: src/%.coffee | |
@mkdir -p $(@D) | |
@$(BIN)/coffee -bcp $< > $@ |
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
lazyproperty = (obj, name, func, enumerable) -> | |
Object.defineProperty obj, name, | |
configurable: true | |
enumerable: not not enumerable | |
get: -> | |
value = func.call(this) | |
Object.defineProperty(this, name, | |
{value, enumerable: !!enumerable, writable: true}) | |
value | |
set: (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
#!/usr/bin/env ruby | |
# Convert SASS/SCSS to Stylus | |
require 'sass' | |
class ToStylus < Sass::Tree::Visitors::Base | |
def visit(node) | |
method = "visit_#{node_name node}" | |
if self.respond_to?(method, true) |
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 'json' | |
require 'uri_template' | |
require 'scorched' | |
class Controller < Scorched::Controller | |
include Scorched::Options('uri_templates') | |
## | |
# Generate URI out of the template |
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
#!/usr/bin/env coffee | |
fs = require 'fs' | |
{Parser, tree} = require 'less' | |
{extend} = require 'underscore' | |
filename = process.argv[2] | |
parser = new Parser(filename: filename) | |
str = fs.readFileSync(filename).toString() |
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
#!/usr/bin/env coffee | |
fs = require 'fs' | |
crypto = require 'crypto' | |
{Parser, tree} = require 'less' | |
{extend, isString} = require 'underscore' | |
filename = process.argv[2] | |
parser = new Parser(filename: filename) | |
str = fs.readFileSync(filename).toString() |