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
# updating collection | |
@listCollection.forEach (item) => | |
item.port = item.port + "__" | |
@listCollection.update item |
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 -> | |
class OrderInfoController | |
getSource: -> | |
source = | |
id: "1" | |
location: "Rome" | |
return source |
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
var express = require('express'); | |
var sockjs = require('sockjs'); | |
var http = require('http'); | |
// 1. Echo sockjs server | |
var sockjs_opts = {sockjs_url: "http://cdn.sockjs.org/sockjs-0.3.min.js"}; | |
var connections = [] | |
var sockjs_echo = sockjs.createServer(sockjs_opts); |
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
onBuildWrite: (moduleName, path, contents) -> | |
if path.match "/bower_components/" | |
pathFragments = path.split "/" | |
index = 0 | |
libName = undefined | |
for fragment in pathFragments | |
if fragment is "bower_components" | |
libName = pathFragments[index + 1] | |
console.log "libName::::", libName |
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
getRandomInt = (min, max) -> | |
return Math.floor(Math.random() * (max - min + 1)) + min |
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 -> | |
runTask = () -> | |
task = Array::slice.call(arguments, 0, 1) | |
rest = Array::slice.call(arguments, 1) | |
@[task].apply @, rest |
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
var makeSealer = function () { | |
var users = [], passwords = []; | |
return { | |
sealer: function (username, password) { | |
var i = users.length, | |
user = {username: username}; | |
users[i] = user; | |
passwords[i] = password; | |
return user; |
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
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
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
var app = require('../../server/app.js'); | |
var model = require('../../model.js'); | |
var request = require('supertest'); | |
var apitest = request(app); | |
describe('integration', function () { | |
it('model.json post should throw 500 error without args', function (done) { | |
apitest.post('/model.json') | |
.expect(500, done); |
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
var ItemsRouter = Router.createClass([ | |
{ | |
route: 'items.length', | |
get: () => { | |
return {path: ['items', 'length'], value: data.items.length} | |
} | |
} | |
]); |