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 cecil | |
// Usage: | |
// ./esclient.js http://your-elasticsearch-host.com | |
var elasticsearch = include('elasticsearch', '^11.0.0'); | |
var moment = include('moment', '^2.13.0'); | |
var R = include('ramda', '^0.21.0'); | |
var Promise = include('bluebird', '^3.4.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
#! /usr/bin/env cecil | |
var Promise = include('bluebird', '3.3.3'); | |
var request = include('request-promise', '3.0.0'); | |
var fs = Promise.promisifyAll(require('fs')); | |
///////////// | |
Promise.all([ | |
basicPromise(), |
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 cecil | |
// Usage: | |
// ./esclear.js http://your-elasticsearch-host.com | |
var elasticsearch = include('elasticsearch', '^11.0.0'); | |
var index = 'testindex'; | |
var host = process.argv[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
var request = include('request-promise', '3.0.0'); | |
var restify = include('restify', '4.1.0'); | |
var server = restify.createServer({ | |
name: 'myapp', | |
version: '1.0.0' | |
}); | |
server.get('/foo', function (req, res, next) { |
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 foo = [{ | |
id: 1, | |
name: 'Mike' | |
}, { | |
id: 2, | |
name: 'Tom' | |
}, { | |
id: 3, | |
name: 'Sally' |
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> | |
</head> | |
<body ng-app="fooApp"> |
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'; | |
module.exports = function each(items, fn, concurrency) { | |
if (items.length === 0) { | |
return Promise.resolve(); | |
} | |
return new Promise((resolve, reject) => { | |
let error = false; |
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'; | |
// A drop-in replacement for Set. | |
// Why? | |
// 1) newSet() can be called as a regular function (no need for new) | |
// 2) None of the functions on it use `this`, which means they can be used as higher-order functions | |
function newSet(initialValues) { | |
const s = new Set(); |
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'; | |
describe('my-foo-directive', function() { | |
var testDirective; | |
var directive; | |
beforeEach(module('app.test.directive')); | |
beforeEach(module('app.templates')); | |
beforeEach(module('app.components.myFooDirective')); |
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'; | |
module.exports = { | |
createSingleLock: createSingleLock, | |
createKeyedLock: createKeyedLock | |
}; | |
// Maintains a list of locks referenced by keys | |
function createKeyedLock() { | |
const locks = {}; |
OlderNewer