Skip to content

Instantly share code, notes, and snippets.

View BobNisco's full-sized avatar
🚀
LGTM

Bob Nisco BobNisco

🚀
LGTM
View GitHub Profile
@samliu
samliu / osx_sleeptimer.py
Last active August 6, 2017 09:32
Sleep timer for itunes and spotify on the command line (for OSX only)
#!/usr/bin/env python
from datetime import datetime, timedelta
import time
import sys
import os
if len(sys.argv) is 3:
music_service = str(sys.argv[1])
minutes_to_wait = float(sys.argv[2])
else:
@paulirish
paulirish / what-forces-layout.md
Last active July 24, 2024 03:23
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