Skip to content

Instantly share code, notes, and snippets.

View DreamShaded's full-sized avatar
🚀
Too much projects

Roman Troitsky DreamShaded

🚀
Too much projects
View GitHub Profile
@DreamShaded
DreamShaded / playwright-arch-linux-fix.md
Created February 6, 2026 21:06 — forked from mewset/playwright-arch-linux-fix.md
Playwright on Arch Linux - use system Chromium instead of bundled

Playwright on Arch Linux - just use system Chromium

So you're on Arch and Playwright is being a pain? Yeah, same. Here's what happens:

$ npm init playwright@latest
BEWARE: your OS is not officially supported by Playwright; installing dependencies for ubuntu24.04-x64 as a fallback.
Installing dependencies...
sh: line 1: apt-get: command not found
Failed to install browsers
@DreamShaded
DreamShaded / promise-tuple.js
Created February 4, 2023 16:44 — forked from fnky/promise-tuple.js
Retrieve tuples from Promise results / async functions
/**
* Returns a Promise which resolves with a value in form of a tuple.
* @param promiseFn A Promise to resolve as a tuple.
* @returns Promise A Promise which resolves to a tuple of [error, ...results]
*/
export function tuple (promise) {
return promise
.then((...results) => [null, ...results])
.catch(error => [error])
}
@DreamShaded
DreamShaded / tsconfig.json
Created December 17, 2021 21:52 — forked from KRostyslav/tsconfig.json
tsconfig.json с комментариями.
// Файл "tsconfig.json":
// - устанавливает корневой каталог проекта TypeScript;
// - выполняет настройку параметров компиляции;
// - устанавливает файлы проекта.
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта.
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта.
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга.
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути.
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию.
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json".
@DreamShaded
DreamShaded / what-forces-layout.md
Created September 19, 2021 13:51 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent