Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dmarcelino's full-sized avatar

Dário dmarcelino

  • AppsCot
  • Lisbon, Portugal
View GitHub Profile
@dmarcelino
dmarcelino / testDecode.js
Last active August 29, 2015 14:16
Decoding OrientDB RID: decodeURIComponent vs string.replace
var n = 5000000;
var encodedRid = '%2310%3A23'; // #10:23
console.time('decodeURIComponent 1/2');
for (var i = 0; i < n; i++) {
decodeURIComponent(encodedRid);
}
console.timeEnd('decodeURIComponent 1/2');
/**
* Example on how to get cursor position programatically with JS
*/
var stdin = process.stdin;
var firstAttempt = true;
function callback() {
var buf = stdin.read();