This file contains hidden or 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
/** | |
* Leaky bucket queue callback. | |
* @callback LeakyBucketCallback | |
* @param {any|null} error Call error. | |
* @param {any=} data Call result. | |
*/ | |
/** | |
* Leaky bucket queue. | |
* @typedef LeakyBucketQueue |
This file contains hidden or 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 | |
const fs = require("fs"); | |
const path = require("path"); | |
const util = require('util'); | |
const readFile = util.promisify(fs.readFile); | |
const writeFile = util.promisify(fs.writeFile); | |
function throwError(err) { | |
throw err; |
This file contains hidden or 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
angular.module('myApp.factories', []) | |
.factory('$fakeStorage', [ | |
function(){ | |
function FakeStorage() {}; | |
FakeStorage.prototype.setItem = function (key, value) { | |
this[key] = value; | |
}; | |
FakeStorage.prototype.getItem = function (key) { | |
return typeof this[key] == 'undefined' ? null : this[key]; | |
} |