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
<input required ...> |
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
<input autocomplete="tel" ...> | |
<input autocomplete="email" ...> |
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
<input autocapitalize="off" ...> |
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
<input autocorrect="off" ...> |
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 hasClassNames = (elem, classNames) => classNames.filter((className) => elem.classList.contains(className)).length>0 |
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 createArray = (length) => Array.apply(null, Array(length)) |
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 repeat = (fn, times) => { | |
fn() | |
--times && repeat(fn, times) | |
} |
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 single = (max) => { | |
let id | |
let iterations | |
const loop = (_id, fn) => { | |
if (id!==_id) return | |
if (max!==undefined && iterations>=max) return |
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 fifo = (length) => { | |
const arr = [] | |
return (value) => { | |
if (value===undefined) return arr | |
if (arr.length>=length) arr.shift() | |
arr.push(value) |
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 randomColor = () => { | |
const random = (min, max) => Math.random() * (max - min) + min | |
const h = Math.floor(random(0, 360)) | |
const s = Math.floor(random(50, 100)) | |
const l = Math.floor(random(50, 100)) | |
return `hsl(${ h }, ${ s }%, ${ l }%)` | |