Skip to content

Instantly share code, notes, and snippets.

View Piterden's full-sized avatar
🇷🇺
Stand with Russia!

Denis Efremov Piterden

🇷🇺
Stand with Russia!
View GitHub Profile
@Piterden
Piterden / layout.kbd.json
Last active July 21, 2021 18:28 — forked from bobbicodes/layout.kbd.json
Untitled Keyboard Layout
[
[
["esc", "1", "2", "3", "/", "\\", "fn","del"],
[ "⇥", "4", "5", "6", "[", "]", "'", "⇦"],
[ "`", "7", "8", "9", "0", "-", "=", ";"],
[ "q", "j", "l", "m", "f", "y", "p", "↩"],
[ "z", ".", "o", "r", "s", "u", "c", "b"],
[ "x", "a", "e", "h", "t", "d", "g", "k"],
[ "↥", ",", "i", "n", "w", "v", "↑", "↥"],
["ctr","sup","alt", " ", " ", "←", "↓", "→"]
const count = 10e6
const length = 100
console.time('generate')
const chars = Array(52).fill().map((_, i) => String.fromCharCode(i < 26 ? i + 65 : i + 71))
const char = () => chars[Math.random() * chars.length | 0]
const triplets = chars.flatMap(a => chars.flatMap(b => chars.flatMap(c => [a, b, c].join(''))))
const triplet = () => triplets[Math.random() * triplets.length | 0]
const main = Array(Math.floor(length / 3)).fill(0)
const tail = Array(length - main.length * 3).fill(0)