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
'use strict'; | |
const { writeFileSync } = require('fs'); | |
const LAST_CODE_POINT = 0x10FFFF; | |
const RegExps = [/./u, /^(?!.)/, /\w/u, /\W/u, /\d/u, /\D/u, /\s/u, /\S/u, /\b/u, /\B/u]; | |
let codePoint = 0; | |
let str; | |
let data = ''; |
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
/******************************************************************************/ | |
'use strict'; | |
/******************************************************************************/ | |
const cp = require('child_process'); | |
const fs = require('fs'); | |
const path = require('path'); | |
/******************************************************************************/ | |
const rootPath = 'j:/temp/node-master'; | |
const nodePath = `${rootPath}/Release/node.exe`; | |
const overPath = path.resolve(rootPath, '..'); |
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
const Word = 'Word'; // In the beginning was the Word, | |
const God = { | |
get [Word]() { // and the Word was with God, | |
return this; // and the Word was God. | |
}, | |
}; | |
console.log(God.Word === God); // The same was in the beginning with God. |
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
javascript: { | |
getCollaboratorsUsernames(); | |
function getCollaboratorsUsernames() { | |
const xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'https://github.com/nodejs/node/blob/master/README.md', true); | |
xhr.responseType = 'document'; | |
xhr.withCredentials = true; | |
xhr.onload = markAuthorsLinks; | |
xhr.ontimeout = xhr.onerror = (evt) => { console.log(evt); }; |
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
javascript: { | |
const validPathname = /^\/nodejs\/node\/pull\/\d+(?:\/commits)?$/; | |
const TITLE_MAX_LENGTH = 50; | |
const LINE_MAX_LENGTH = 72; | |
const titleFormat = /^([\d_a-z ,-]+)\b: ([a-z'-]+\b)?/; | |
const lineWithURLFormat = /^(Fixes|Refs?): (https?:)?/; | |
const LOG_DELIMITER_LENGTH = 20; |
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
'use strict'; | |
const str = '\ud83d\udc0e'.repeat(1e4); // 🐎 | |
const re = new RegExp('', 'u'); // or /[^]{0}/u | |
let symbols; | |
let i; | |
console.time('RegExp'); | |
for (i = 0; i < 1e4; i++) symbols = str.split(re); |
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
improvement confidence p.value | |
buffers\\buffer-base64-decode.js n=32 -0.03 % 6.813796e-01 | |
buffers\\buffer-base64-encode.js n=32 len=67108864 0.10 % 7.395115e-02 | |
buffers\\buffer-bytelength.js n=5000000 len=1 encoding="base64" 16.14 % *** 5.629742e-46 | |
buffers\\buffer-bytelength.js n=5000000 len=1 encoding="utf8" -36.00 % *** 2.712131e-60 | |
buffers\\buffer-bytelength.js n=5000000 len=16 encoding="base64" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<ItemGroup Label="ProjectConfigurations"> | |
<ProjectConfiguration Include="Debug|Win32"> | |
<Configuration>Debug</Configuration> | |
<Platform>Win32</Platform> | |
</ProjectConfiguration> | |
<ProjectConfiguration Include="Debug|Win32"> | |
<Configuration>Debug</Configuration> | |
<Platform>Win32</Platform> |
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 functionToCheckMonomorphic(functionToApplyMonomorphic) { | |
functionToApplyMonomorphic.apply(null, arguments); | |
} | |
function functionToCheckPolymorphic(functionToApplyPolymorphic) { | |
functionToApplyPolymorphic.apply(null, arguments); | |
} | |
const functionToApplyCommon1 = function () {}; | |
const functionToApplyCommon2 = function () {}; |
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
/******************************************************************************/ | |
'use strict'; | |
/******************************************************************************/ | |
// title progress bar as a module | |
module.exports = function pbt(edge = 0) { | |
const savedTitle = process.title; | |
const DEFAULT_FREQ = 500; | |
const HUNDRED_PERCENT = 100; |