Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / what-forces-layout.md
Last active January 13, 2026 11:04
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
@SwadicalRag
SwadicalRag / repeat.lua
Last active April 21, 2017 12:17
Repeat after me
local function ParseStatement(msg,repper)
if(msg:match("^repeat[ \n\r\t]-after[ \n\r\t]-.-[ \n\r\t]-.+[ \n\r\t]-ty")) then
local to_repeat = msg:match("^repeat[ \n\r\t]-after[ \n\r\t]-.-[ \n\r\t]-[\"'](.+)[\"'][ \n\r\t]-x[ \n\r\t]-%d-[ \n\r\t]-ty")
local n = msg:match("^repeat[ \n\r\t]-after[ \n\r\t]-.-[ \n\r\t]-[\"'].+[\"'][ \n\r\t]-x[ \n\r\t]-(%d+)[ \n\r\t]-ty")
local person = msg:match("^repeat[ \n\r\t]-after[ \n\r\t]-([^ ]+)[ \n\r\t]-[\"'].+[\"'][ \n\r\t]-x[ \n\r\t]-%d+[ \n\r\t]-ty")
if not (to_repeat and tonumber(n) and person) then return end
local out = ""
local repper = (repper or "\n")
for i=1,tonumber(n) do
out = out..to_repeat..repper
@nocturnalgeek
nocturnalgeek / MailinatorAliases
Last active June 18, 2025 22:06
A list of alternate domains that point to @mailinator.com
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@staltz
staltz / introrx.md
Last active January 13, 2026 23:10
The introduction to Reactive Programming you've been missing
@debasishg
debasishg / gist:8172796
Last active December 31, 2025 22:20
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
anonymous
anonymous / night-before-opsmas.txt
Created December 24, 2013 07:19
Twas the night before Opsmas..
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
@lucasdinonolte
lucasdinonolte / binarytree.coffee
Last active March 2, 2018 19:10
Data Structures in CoffeeScript – a growing collection
class Node
cargo : null
left : null
right : null
constructor : (@cargo) ->
class Tree