Skip to content

Instantly share code, notes, and snippets.

View alex-w-dev's full-sized avatar
🤣
I may be slow to respond.

Alexander Chertkov alex-w-dev

🤣
I may be slow to respond.
View GitHub Profile
@alex-w-dev
alex-w-dev / word-game-hack.js
Last active November 3, 2022 05:45
Подобрать слова к кроссворду (или игра 5 букв от тиньков)
This file has been truncated, but you can view the full file.
const filtered = allWords()
// фильтр по длине слова
.filter(w => w.length ===5)
// фильтр по позиции буквы в слове
.filter(w => w[0] === 'д' && w[1] === 'о' && w[3] === 'о')
// фильтр по буквам которых НЕ должно быть в слове
.filter(w => !(/[иванебютрз]/.test(w)))
console.log(filtered, 'filtered');
function allWords() {
@alex-w-dev
alex-w-dev / intex.js
Last active March 30, 2021 08:54
Java Script async sleep - make timeout for some seconds in async function
// sleep function
function sleep(timeout) {
return new Promise(res => setTimeout(res, timeout || 1000))
}
// example:
(async () => {
await sleep(3000);
console.log('this code will run after 3 seconds')
})()