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' | |
gulp = require 'gulp' | |
gutil = require 'gulp-util' | |
browserify = require 'browserify' | |
header = require 'gulp-header' | |
uglify = require 'gulp-uglify' | |
pkg = require './package.json' | |
source = require 'vinyl-source-stream' |
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
/** | |
* Module dependencies | |
*/ | |
'use strict'; | |
var buildDictionary = require('sails-build-dictionary'); | |
module.exports = function Responses(sails) { | |
return { | |
loadResponses: function(cb) { |
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
12/02/2015 08:54:27.693 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2 | |
12/02/2015 08:54:27.693 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2 | |
12/02/2015 08:54:27.693 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2 | |
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2 | |
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2 | |
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2 | |
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2 | |
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2 | |
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 2 | |
12/02/2015 08:54:27.694 Finder[1474]: !!! _NSGlyphTreeInsertGlyphs glyph index issue 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
'use strict'; | |
var path = require('path'); | |
var workerFarm = require('worker-farm'); | |
var numCPUs = require('os').cpus().length; | |
var argv = require('optimist') | |
.alias('n', 'cores') | |
.default('n', numCPUs) | |
.alias('w', 'workers') |
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
// Example based in Substack Stream Handbook: | |
// https://github.com/substack/stream-handbook#creating-a-readable-stream | |
'use strict' | |
var inherits = require('inherits') | |
var duplexify = require('duplexify') | |
var Stream = require('readable-stream').Stream | |
var CONST = { |
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 count = 0 | |
function asyncFn (cb) { | |
setTimeout(function () { | |
console.log('emit new chunk') | |
return cb(null, {foo: 'bar'}) | |
}, 500) | |
} | |
module.exports = function () { |
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
{ | |
"app": "YOUR_APP_NAME", | |
"cred": { | |
"appid": "YOUR_APP_ID", | |
"apikey": "YOUR_APP_KEY" | |
}, | |
"oldentries": 86400000, | |
"index": { | |
"name": "YOUR_INDEX_NAME", | |
"settings": { |
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
/** | |
* ES6 Pure & self documented Functions. | |
* | |
* Why Pure? | |
* | |
* A pure function is a function where the return value is only determined | |
* by its input values, without observable side effects. | |
* | |
* Why Self-documented? | |
* |
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' | |
const _simpleArrayDiff = require('simple-array-diff') | |
const { map, range, random } = require('lodash') | |
const suite = require('fastbench') | |
const _hyperDiff = require('.') | |
const _range = range(0, 1000) | |
function generateRange (_range) { | |
return map(_range, () => { return { id: random(0, 100) } }) | |
} |
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 utf8 = require('utf8'); | |
var val1 = utf8.decode('\xE2\x80\x99'); | |
const StringDecoder = require('string_decoder').StringDecoder; | |
const decoder = new StringDecoder('utf8'); | |
const symbol = new Buffer([0xE2, 0x80, 0x99]); | |
const val2 = decoder.write(symbol); | |
console.log(val1); |