made with esnextbin
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
operatorInt = (count, items) -> | |
i=0 | |
start = (new Date).getTime() | |
while(i++ != count) | |
items[0] = 1000 | |
return (new Date).getTime() - start | |
operatorSimple = (count, items) -> |
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
'use strict'; | |
function getDistinctObjArray(arr) { | |
var distinctArr = arr.filter(function(el) { | |
var isDup = el.inArray; | |
el.inArray = true; | |
return !isDup; | |
}); | |
distinctArr.forEach(function(el) { | |
delete el.inArray; |
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
socket.on('message', function(data) { | |
//ListView needs to be updated based on the data and the current selected tab | |
if (user_current_tab === 'special_tab_1') { | |
take_action_for_special_tab_1(data); | |
} else if (user_current_tab === 'special_tab_2') { |
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 IEvent | |
constructor: -> | |
@_rules = [] | |
set_description: (@description) -> | |
is_it_on: (date) -> | |
sorted_rules = @_rules | |
for rule in sorted_rules | |
if rule.execute date is yes |
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
global.TimeMarker = { | |
current: process.uptime(), | |
start: function () { | |
this.current = process.uptime(); | |
}, | |
mark: function () { | |
e = new Error() | |
console.log((process.uptime() - this.current) + 's', e.stack.split('\n') | |
.slice(2, 3)[0].replace(/ *at/, '')); | |
this.start(); |
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
"use strict"; | |
var should = require('chai').should(); | |
var _bind = Function.prototype.bind; | |
var _each = function (arr, callback, ctx) { | |
for (var i = 0; i < arr.length; i++) { | |
callback.call(ctx, arr[i]); | |
} | |
}; | |
var _find = function (arr, callback, ctx) { |
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
Q = require 'q' | |
chai = require 'chai' | |
.should() | |
chain = (proto) -> | |
obj = | |
_value: null | |
value: -> @_value | |
for k, v of proto | |
obj[k] = chain._actionCreate proto, obj, k, v | |
obj |
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
### HOW TO USE | |
### curl -L PATH | sh | |
# Package Install | |
sudo apt-get install mosh | |
# Install via CURL | |
# Oh My ZSH | |
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh | |
sudo chsh -s /bin/zsh |
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
"use strict"; | |
var express = require('express'), | |
app = express(), | |
CHAR = '*', | |
port = 3000; | |
var defer = Promise.defer(); | |
app.get('/chunk/:size.txt', function (req, res) { | |
var count = 0, | |
size = parseInt(req.params.size); |
OlderNewer