This file contains hidden or 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
module Helpers | |
def select2(scope, opts) | |
scope.find('.select2-choice').click | |
if opts.has_key? :type_in | |
input = find '.select2-drop-active:not(.select2-offscreen) .select2-search .select2-input' | |
input.set opts[:type_in] | |
input.trigger('keyup-change') | |
end |
This file contains hidden or 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
Q = require 'q' | |
_ = require 'underscore' | |
photos = [1..100] | |
partition = (n, coll) -> | |
_.values(_.groupBy(coll, (x, i) -> Math.floor i/n)) | |
scaleImage = (img, i) -> | |
Q.delay(200).then -> console.log "processed image #{i}" |
This file contains hidden or 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
express = require 'express' | |
path = require 'path' | |
http = require 'http' | |
logger = require 'winston' | |
app = express() | |
logger.setLevels logger.config.syslog.levels | |
logger.remove logger.transports.Console | |
logger.add logger.transports.Console, |
This file contains hidden or 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
var phantom = require('james-phantomjs'), | |
mocha = require('james-mocha'), | |
dotReporter = require('james-dot-reporter'); | |
mocha(james.list('test/*Helper.js', 'test/*Spec.js')) | |
.transform(phantom) | |
.transform(dotReporter); |
This file contains hidden or 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
through = require('through'); | |
module.exports = function (file) { | |
var tr = through(null, function () { | |
this.queue('}).call(module.exports)'); this.queue(null) }); tr.pause(); | |
tr.queue('(function(){'); process.nextTick(tr.resume.bind(tr)); return tr; | |
} |
This file contains hidden or 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
var assert = require('assert'), | |
StringStream = require('../index'), | |
data = "Hello World!", | |
src = new StringStream(data), | |
dest = new StringStream(); | |
src.pipe(dest); | |
dest.on('finish', function() { | |
assert.equal(src.data, ''); |
This file contains hidden or 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
/* | |
<div class="template"> | |
<div class="todo"></div> | |
<div> | |
*/ | |
data = [ |
This file contains hidden or 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
exports.hello = function(name) { | |
console.log("Hello, " + name); | |
} |
This file contains hidden or 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
# Do something before the method | |
before = (decorator) -> (method) -> -> | |
decorator.apply this, arguments | |
method.apply this, arguments | |
# Do something after the method | |
after = (decorator) -> (method) -> -> | |
method.apply this, arguments | |
decorator.apply this, arguments |
This file contains hidden or 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
{ | |
"name": "jee", | |
"version": "0.0.0", | |
"dependencies": { | |
"bowling": "git://github.com/pyykkis/bowling.git" | |
} | |
} |