Skip to content

Instantly share code, notes, and snippets.

View doulovera's full-sized avatar
🖥️
On

Douglas Lovera doulovera

🖥️
On
View GitHub Profile
@SalahHamza
SalahHamza / install_ngrok.md
Last active April 25, 2024 16:05
How to install ngrok on linux subsystem for windows
@paulirish
paulirish / what-forces-layout.md
Last active May 11, 2024 00:41
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
@wiltonbsilva
wiltonbsilva / cpf-regex
Created June 14, 2014 12:26
Regular Expression to match a Brazilian CPF (similar to an SSN)
RegEx:
^([-\.\s]?(\d{3})){3}[-\.\s]?(\d{2})$
Test:
345.753.428-40
Test:
345.753.422.99
Test:
123-543-667.54
Test: