Skip to content

Instantly share code, notes, and snippets.

View jwill's full-sized avatar

James Williams jwill

View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active May 23, 2024 14:12
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

Stealing WiFi

/etc/hosts

This will let you access any google owned site. This includes: youtube, google cache, google translate, google search, gmail, google news, etc.

  • Install the HTTPS Everywhere extension
  • Add these rules to your /etc/hosts file
@dgryski
dgryski / godef.vim
Last active December 14, 2015 22:09
vim plugin for godef
" needs https://code.google.com/p/rog-go/source/browse/exp/cmd/godef/godef.go
if !exists("g:godef_command")
let g:godef_command = "godef"
endif
function! GodefUnderCursor()
let offs=line2byte(line('.'))+col('.')-1
call Godef("-o=" . offs)
endfunction