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 Foo() { | |
Emitter.call(this); | |
this._init(function(error) { | |
console.log('init done'); | |
if (error) { | |
that.emit('error', error); | |
} else { | |
that.emit('initialize'); | |
} |
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
thoughts on possible concept to cache responses of a rest api | |
* save any response to GET with the called URL as the key (including relevant get parameters like limit, offset or order) | |
* on each POST to a certain resource invalidate cache keys by the following scheme | |
POST /user | |
/user(\?(.+))? | |
POST /user/1/transaction | |
/user |
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 _ = { | |
concat: function() { | |
var arrays = Array.prototype.slice.call(arguments); | |
return { | |
forEach: function(iterator) { | |
arrays.forEach(function(subArray) { | |
subArray.forEach(function(value) { | |
iterator(value); | |
}); |
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
macro inlineArgs { | |
rule {} => { | |
(function(outerArguments) { | |
var argsArray = []; | |
for (var i = 0; i < outerArguments.length; i++) { | |
argsArray.push(outerArguments[i]); | |
} | |
return argsArray; | |
})(arguments) | |
} |
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
Project I: Foo_API | |
Project II: Foo_Frontend | |
Project III: Foo_Configuration | |
Project IV: Bundle of API, Frontend, Configuration | |
Build, Test and Deployment of all four Projects should happen whenever one of the four projects changes. |
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
<?php | |
/** | |
* Shopware 4 | |
* Copyright © shopware AG | |
* | |
* According to our dual licensing model, this program can be used either | |
* under the terms of the GNU Affero General Public License, version 3, | |
* or under a proprietary license. | |
* | |
* The texts of the GNU Affero General Public License with an additional |
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 iterator = combinations([1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13]); | |
var handle = setInterval(function() { | |
var next = iterator.next(); | |
if (next.done) { | |
clearInterval(handle); | |
} else { | |
console.log(next.value); | |
} | |
}, 1000); |
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 Emitter = require('events').EventEmitter; | |
var util = require('util'); | |
function StateWrapper(client) { | |
Emitter.call(this); | |
this._state = { | |
altitude: 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
function myObject() { | |
function initialize() { | |
//do something | |
someAsynchrounosFunction( function (err, data) { | |
this.emit( 'init' ); | |
} ); | |
} | |
initialize(); |
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 data = [] | |
,number = 5000 | |
,numberElements = 130 | |
,numberQueries = 15; | |
for( var i = 0; i < number; i++ ) { | |
data[ i ] = {}; | |
for( var x = 0; x < numberElements; x++ ) { |
OlderNewer