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
processRouteMap = (routes) -> | |
requirejs.config | |
nodeRequire: require | |
paths: | |
"routeMap" : __dirname + "/../../../app/js/" + "routeMap" | |
"requireConfig" : __dirname + "/../../../app/js/" + "requireConfig.js" | |
"text" : __dirname + "/../../../app/js/vendors/requirejs-text/text" | |
requirejs ["routeMap", "text!requireConfig"], (routeMap, requireConfig) -> | |
console.log "requireConfig", requireConfig |
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 -> | |
findNested = (obj, key, memo) -> | |
i = undefined | |
memo = [] if Object::toString.call(memo) isnt "[object Array]" | |
for i of obj | |
if Object::hasOwnProperty.call(obj, i) | |
if i is key | |
memo.push obj[i] | |
else findNested obj[i], key, memo if Object::toString.call(obj[i]) is "[object Object]" | |
memo |
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 [ | |
"underscore" | |
"when" | |
], (_, When) -> | |
return (options) -> | |
extend = (componentDefinition, wire) -> | |
When.promise (resolve) -> |
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 AutoCompleteController | |
# @injected | |
input: undefined | |
# @injected | |
listCollection: undefined | |
curId: 0 |
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 |
OlderNewer