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.prototype._makeLikeNative = function() | |
{ | |
if(Object.defineProperty) | |
{ | |
var blackLabelProp = | |
{ | |
enumerable: false, | |
configurable: false, | |
writable: false, | |
value: true |
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 i, n = 10000, m = 10; | |
var a = new Array(m); | |
var d = +new Date(); | |
i = m; while(i--) | |
a[i] = '1'; | |
console.log('fill array', new Date - d); | |
var d = +new Date(); | |
i = n; while(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
// very basic example and don`t remember api. Sorry | |
var firstWord = 'hello', lastWord = 'world!'; | |
var firstNode = document.evaluate('//text()[contets(.,"' + firstWord + '")]', root ....).snapshotItem(0); | |
var lastNode = document.evaluate('//text()[contets(.,"' + lastWord + '")]', root ....).snapshotItem(0); | |
var range = document.createRange(); | |
range.setStart(firstNode, firstNode.data.indexOf(firstWord)); | |
range.setEnd(lastNode, lastNode.data.lastIndexOf(lastWord) + lastWord.length); |
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
FormsEngine.WcmController = function() { | |
this.type = "ECM"; | |
}; | |
FormsEngine.WcmController.prototype.downloadTypeTaxonomyInst = function(siteId) { | |
return "hello " +siteId; | |
}; | |
var controller = new FormsEngine.WcmController(); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
typedef int uint; | |
uint _sha1(uint * xs, uint len) | |
{ | |
uint v85,v84,v83,v82,v81,v80,v79,v78,v77,v76,v75,v74,v73,v72,v71,v70,v69,v68,v67,v66,v65,v64,v63,v62,v61,v60,v59,v58,v57,v56,v55,v54,v53,v52,v51,v50,v49,v48,v47,v46,v45,v44,v43,v42,v41,v40,v39,v38,v37,v36,v35,v34,v33,v32,v31,v30,v29,v28,v27,v26,v25,v24,v23,v22,v21,v20,v19,v18,v17,v16,v15,v14,v13,v12,v11,v10,v9,v8,v7,v6,v5,v4,v3,v2,v1,v0; | |
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() | |
{ | |
var _oldBind = Function.prototype.bind, _slice = Array.prototype.slice, | |
_toString = function() | |
{ | |
return '' + this._fn; | |
}; | |
Function.prototype.bind = function(that) | |
{ |
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
if(!console.log) | |
console.log = $jb._log; | |
console.time = $jb._timerBegin; | |
console.timeEnd = $jb._timerEnd; | |
var i, n = 40000, | |
a = '11111111111111111111111111111111'; | |
console.time("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
if(!console) | |
console = {}; | |
if(!console.log) | |
console.log = $jb._log; | |
console.time = $jb._timerBegin; | |
console.timeEnd = $jb._timerEnd; | |
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 _propertyNameSanitize = (function() | |
{ | |
var re = new RegExp(/-([a-z])/g); | |
var _replacer = function (str, cap) { | |
return cap.toUpperCase(); | |
}; | |
return function (propertyName) { | |
return propertyName.replace(re, _replacer); | |
}; |
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 _nodeUnique = function (nodeArray) | |
{ | |
var len = nodeArray.length, i = 0; | |
while (i < len && nodeArray[i] !== nodeArray[++i]) | |
; | |
if(i >= len) | |
return nodeArray; | |