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
| var crypto = require('crypto'); | |
| var obj = new Object(), | |
| i = 0, | |
| key, | |
| body, | |
| selectedKeys = []; | |
| console.log("Starting generation"); | |
| console.time("GENERATION"); | |
| for (i; i < 100000; i++) { | |
| key = "key_" + i + "_" + crypto.createHash('md5').update(i + "aaaa" + Date.now()).digest("hex"); |
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
| // ################################# PCLASS | |
| function wrap(method, superMethod){ | |
| //check if supetMethod actualy has any parent call | |
| if (method.toString().match(/.+\.parent\(.+/)) { | |
| return function(){ | |
| this.parent = superMethod; | |
| var result = method.apply(this, arguments); | |
| delete this.parent; | |
| return result; | |
| }; |
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
| // ################################# CLASS | |
| function Class( fn ){ | |
| var object = new fn(), nc = fn, superObject; | |
| if(object.hasOwnProperty('initialize')){ | |
| fn = object.initialize; | |
| //delete object.initialize; | |
| } | |
| if(object.hasOwnProperty('Extends')){ | |
| var SuperConstructor = object.Extends; | |
| delete object.Extends; |
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
| // ################################# CLASS | |
| function Class( fn ){ | |
| var object = new fn(), nc = fn, superObject; | |
| if(object.hasOwnProperty('initialize')){ | |
| fn = object.initialize; | |
| } | |
| if(object.hasOwnProperty('Extends')){ | |
| var SuperConstructor = object.Extends; | |
| delete object.Extends(); | |
| fn.prototype = new SuperConstructor(); |
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
| exports.Class = function(object){ | |
| //real konstructor | |
| var newClass = function() { | |
| if(this.__proto__.initialize){ | |
| var that = this.__proto__.initialize.apply(this, arguments); | |
| return that | |
| } | |
| return this; | |
| } | |
| //obsluga dziedziczenia |
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
| exports.Class = function(object){ | |
| //real konstructor | |
| var newClass = function() { | |
| if(this.__proto__.initialize){ | |
| var that = this.__proto__.initialize.apply(this, arguments); | |
| return that | |
| } | |
| return this; | |
| } | |
| //obsluga dziedziczenia |