Skip to content

Instantly share code, notes, and snippets.

@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
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 10, 2024 19:40
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@jasonlong
jasonlong / Default (OSX).sublime-keymap
Created April 16, 2013 11:53
A simple way to toggle between dark and light themes in Sublime Text 2.
// Copy this to your keybindings (Preferences > Key Bindings - User)
// Change the keybinding, color schemes, and themes to your preferences
{ "keys": ["ctrl+1"], "command": "toggle_color_scheme",
"args": {
"light_color_scheme": "Packages/User/Espresso Soda.tmTheme",
"dark_color_scheme": "Packages/User/Monokai Soda.tmTheme",
"light_theme": "Soda Light.sublime-theme",
"dark_theme": "Soda Dark.sublime-theme"
}
@harthur
harthur / snippet.md
Created June 18, 2012 22:12
console.log() key binding for Sublime Text

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }
 }