Skip to content

Instantly share code, notes, and snippets.

View aetheon's full-sized avatar

Oscar Brito aetheon

View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active April 15, 2025 07:29
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
@noamtm
noamtm / build-dist.sh
Created February 1, 2015 15:18
iOS: Re-sign an app for distribution
# This is not a ready-to-run script. It just shows the relevant command-line calls.
XC_WORKSPACE=path/to/MyApp.xcworkspace
XC_SCHEME=MyApp
XC_CONFIG=Release
ARCHIVE_PATH=dest/path/to/MyApp.xcarchive
EXPORT_PATH=dest/path/to/MyApp.ipa
DIST_PROFILE=NameOfDistributionProfile
# Build and archive. This can be done by regular developers, using their developer key/profile.
@elijahmanor
elijahmanor / jokes.md
Last active February 18, 2024 05:02
Front-End Web Dev Jokes

Front-End Web Dev Jokes

Authored by Elijah Manor

  • q. How do you comfort a JavaScript bug? a. You console it

  • When a JavaScript date has gone bad, "Don't call me, I'll callback you. I promise!"

  • Dev1 saw a strange JavaScript function & asked, "What is this?". Dev2 responded, "I don't know. I would've called you, but I was in a bind"

@hyle
hyle / ko.utils.signatures.js
Last active February 24, 2025 14:47
KnockoutJS utils (ko.utils) signatures
// knockout 2.2.1
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
ko.utils.arrayForEach = function (array, action) { /* .. */ }
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ }