Skip to content

Instantly share code, notes, and snippets.

@albert-zhang
albert-zhang / what-forces-layout.md
Created November 25, 2021 02:17 — 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
@albert-zhang
albert-zhang / Apple_mobile_device_types.txt
Created November 22, 2021 08:31 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@albert-zhang
albert-zhang / another.sh
Last active December 3, 2018 01:59 — forked from jobsamuel/readme.md
Run NodeJS as a Service on Ubuntu 14.04 LTS
start on filesystem and started networking
respawn
chdir /home/work/node-app
env NODE_ENV=production
exec /usr/bin/node /home/work/node-app/index.js