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 NATIVES = { | |
'Array': 1, | |
'Boolean': 1, | |
'Date': 1, | |
'decodeURI': 1, | |
'decodeURIComponent': 1, | |
'encodeURI': 1, | |
'encodeURIComponent': 1, | |
'eval': 1, | |
'Error': 1, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Aeris.js MarkerCollection example</title> | |
<style type="text/css"> | |
html, body { | |
width: 100%; | |
height: 100%; | |
margin: 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
require.config({ | |
paths: { | |
aeris: 'bower_components/aerisjs/src', | |
// Aeris.js dependencies | |
underscore: 'bower_components/underscore/underscore', | |
jquery: 'bower_components/jquery/jquery', | |
backbone: 'bower_components/backbone/backbone', | |
leaflet: '//cdn.leafletjs.com/leaflet-0.7.2/leaflet-src', | |
'leaflet-markercluster': 'bower_components/leaflet.markercluster/dist/leaflet.markercluster-src', |
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
<a class="closeBtn">.closeBtn</a> | |
<div class="acme-app"> | |
<a class="closeBtn">.acme-app .closeBtn</a> | |
</div> | |
<div class="acme-app"> | |
<div class="reset"> | |
<a class="closeBtn">.acme-app .reset .closeBtn</a> | |
</div> |
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([ | |
'vendor/underscore', | |
'when' | |
], function(_, when) { | |
/** | |
* Helper class for | |
* the listenTo facet. | |
* | |
* @param proxy |
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
/* Prevent the text contents of draggable elements from being selectable. */ | |
[draggable] { | |
-moz-user-select: none; | |
-khtml-user-select: none; | |
-webkit-user-select: none; | |
user-select: none; | |
/* Required to make elements draggable in old WebKit */ | |
-khtml-user-drag: element; | |
-webkit-user-drag: element; | |
} |
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
const _ = require('lodash'); | |
function series(count, asyncFn) { | |
return _.range(0, count) | |
.reduce((lastRun_, i) => { | |
return lastRun_.then(() => asyncFn(i)) | |
}, Promise.resolve()); | |
} | |
series(10, (i) => { |
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
const assert = require('assert'); | |
const _ = require('lodash'); | |
function throwsAsync(block, expectedError, message) { | |
return block() | |
.then(res => { | |
assert.fail(res, expectedError, message, 'is'); | |
}, err => { | |
if (_.isFunction(expectedError)) { | |
// note that assert.throws doesn't work with custom Error constructors |
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
function mockReadFile(mockPath, content) { | |
// see https://gist.github.com/eschwartz/955a3f8925e24270550cb635dd49c12b | |
const deferred = Deferred(); | |
sinon.stub(fs, 'readFile', _.wrap(fs.readFile, (origFn, path, encoding, cb) => { | |
if (path !== mockPath) { | |
return origFn.readFile(path, encoding, cb); | |
} | |
// Only resolve `fs.readFile` when deferred is resolved |
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
#!/usr/bin/env node | |
/** | |
* Usage: | |
* | |
* node cluster.js ./worker-script.js | |
*/ | |
const cluster = require('cluster'); | |
const path = require('path'); | |
function startCluster(runWorker, opts) { |
OlderNewer