Usage:
function myRandomFunction() {
return Math.random() * 100 | 0;
}
const testRF = testRandomFunction({
randFn: () => { myRandomFunction(); },
runsPerCycle: 1e5,Usage:
function myRandomFunction() {
return Math.random() * 100 | 0;
}
const testRF = testRandomFunction({
randFn: () => { myRandomFunction(); },
runsPerCycle: 1e5,| { | |
| "rules": { | |
| "domain": [ | |
| ".com .net .org and .info domain names cannot exceed 67 characters", | |
| ".info and .biz must have at least 3 characters not including .info and .biz", | |
| "Other domain names cannot exceed 22 characters not including the extension", | |
| "2 letter domains are not allowed." | |
| ], | |
| "edge-cases": [ | |
| "'http://url.com/path///////otherpath' is technically valid per RFC 3986 and 9110. Most servers normalize or collapse them ('/path///////otherpath' and '/path/otherpath' yield the same resource), others don't (several empty segments (\"\") between 'path' and 'otherpath').", |
| const regExVersion = new RegExp([ | |
| // starts with "v" ➔ v1, v2, v56, v100 works. vv1, 12345, 1.2.3 fails. | |
| "^(?:v)", | |
| // major version: either "0" or a number that not starts with 0. ➔ v01 fails | |
| "(?<major>(?:[1-9][0-9]*)|(?:0))", | |
| // minor version (optional) - same as major ➔ v1.1, v0.1, v2.15, v9, v9.0, v9.9 works. v9.09 fails | |
| "(?:\.(?<minor>(?:[1-9][0-9]*)|(?:0)))?", | |
| // revision (optional too) - same as major ➔ v1.2.3, v0.0.1, v9.0.9 works, v0.0.0, v6.5.04 fails. | |
| "(?:\.(?<revision>(?:[1-9][0-9]*)|(?:0)))?", |
| .BEM { | |
| --B: block, #1; | |
| --E: element, #2; | |
| --M: modifier, #3; | |
| --USAGE: block__element--modifier; | |
| --USAGE: nibol-slider__item--active; | |
| } | |
| *:nth-child(1) { |
| const makeColorFormatConverterHelpers = (() => { | |
| function rgbToHsl([r, g, b]) { | |
| r /= 255; g /= 255; b /= 255; | |
| const max = Math.max(r, g, b), min = Math.min(r, g, b); | |
| let h, s, l = (max + min) / 2, d = max - min; | |
| if (!d) h = s = 0; | |
| else { | |
| s = l > 0.5 ? d / (2 - max - min) : d / (max + min); | |
| switch (max) { | |
| case r: h = (g - b) / d + (g < b ? 6 : 0); break; |
| const example = (() => { | |
| const content = H("<div class=content>"+ | |
| "<p>quia dolor sit, amet, consectetur, adipisci velit</p>"+ | |
| "<p>sed quia non numquam eius modi tempora incidunt,</p>"+ | |
| "<p>ut labore et dolore magnam aliquam quaerat voluptatem.</p>"+ | |
| "</div>"); | |
| const card = H("<section>"+ | |
| "<header><h1>Dolorem Ipsum</h1></header>"+ | |
| content.outerHTML, | |
| "</section>"); |
| // Example usage: | |
| console.log(testWidthReductionTechniques("Hello World")); | |
| console.log(runWidthTests()); | |
| function testWidthReductionTechniques(inputText) { | |
| // Store original for comparison | |
| const original = inputText; | |
| // Key directional control characters | |
| const RLM = "\u200F"; // Right-to-Left Mark |
| async function listMostRecentlyActiveRepos(org, project, maxCommits=15) { | |
| const base = `https://dev.azure.com/${org}/${project}/_apis/git/repositories?api-version=7.1-preview.1`; | |
| const repos = await fetch(base).then(r => r.json()); | |
| const activeRepos = []; | |
| const data = [] | |
| for (const repo of repos.value) { | |
| const commitsUrl = `https://dev.azure.com/${org}/${project}/_apis/git/repositories/${repo.id}/commits?$top=${maxCommits}&api-version=7.1-preview.1`; |
| const commonStyles = "display: block; position: fixed; z-index: 9999999; transition: opacity 100ms ease; left 100ms ease; top: 100ms ease; right: 100ms ease; bottom: 100ms ease; width: 100ms ease; height: 100ms ease;" | |
| const jequitiSettings = { | |
| min: 5000, | |
| max: 30000, | |
| duration: 500, | |
| waitLoad: 1000, | |
| waitRemove: 200, | |
| tid: null, | |
| src: "https://fraguru.com/mdimg/dizajneri/o.1954.jpg", | |
| id: "jequiti-overlay", |