Skip to content

Instantly share code, notes, and snippets.

View 0xka13b's full-sized avatar
☘️

Vlad Kolebayev 0xka13b

☘️
View GitHub Profile
@miguelmota
miguelmota / fallbackProvider.js
Last active February 2, 2023 10:59
JavaScript ethers fallback provider example
const { providers } = require('ethers')
async function main() {
const url1 = 'https://optimism-mainnet.infura.io/v3/84842078b09946638c03157f83405213'
const url2 = 'https://mainnet.optimism.io'
const stallTimeout = 2 * 1000
const options = {
timeout: 60 * 1000,
throttleLimit: 1
}
@paulirish
paulirish / what-forces-layout.md
Last active June 10, 2026 01:58
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