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
{ | |
"env": {"mocha": true}, | |
"globals": { | |
"assert": false, | |
"sinon": false, | |
"chai": false | |
} | |
} |
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 bash | |
set -e | |
COLOR_RED="\e[0;31m" | |
COLOR_GREEN="\e[0;32m" | |
COLOR_YELLOW="\e[0;33m" | |
COLOR_RESET="\e[0m" | |
SEPARATOR="${COLOR_YELLOW}----------${COLOR_RESET}" |
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
/** | |
* Get UTF-8 string length in bytes | |
* @see http://stackoverflow.com/questions/2848462/count-bytes-in-textarea-using-javascript | |
* | |
* @param {String} string | |
* @returns {Number} | |
*/ | |
function countUtf8Bytes(string) { | |
var utf8length = 0; | |
for (var i = 0; i < string.length; i++) { |
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 fs = require('fs'), | |
profiler = require('v8-profiler'), | |
runSelectionSort = require('./selection-sort'), | |
runMergeSort = require('./merge-sort'); | |
profiler.startProfiling('sort-app'); | |
console.time('selection sort'); | |
runSelectionSort(); |
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
// ==UserScript== | |
// @name Открыть Видео с диска | |
// @namespace yandex | |
// @include https://yadi.sk/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
window.addEventListener('load', main); |
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
/** | |
* Universal custom error class | |
* @param {String} message | |
* @param {Error} [prevError] | |
* @constructor | |
*/ | |
function CustomError(message, prevError) { | |
if (!CustomError.isInstance(this)) { | |
// Can't use custom errors like `throw Error('Message')` | |
// because of stack capturing |
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.fastElements = function(obj) { | |
if (%HasFastSmiElements(obj)) { | |
console.log('Fast SMI elements'); | |
} | |
if (%HasFastSmiOrObjectElements(obj)) { | |
console.log('Fast SMI or Object elements'); | |
} | |
if (%HasFastObjectElements(obj)) { | |
console.log('Fast Object elements'); | |
} |
NewerOlder