Skip to content

Instantly share code, notes, and snippets.

View kkokey's full-sized avatar
🎯
Focusing

namedboy kkokey

🎯
Focusing
View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active July 22, 2024 06:32
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
@tsprates
tsprates / HmacSHA512.java
Created May 28, 2014 16:44
Hmac SHA512
/**
* HmacSHA512
*
* @see <http://drumcoder.co.uk/blog/2011/apr/21/calculate-hmac-hash-java/>
* @param String value
* @param String secret
* @return String
*/
private String buildHmacSignature(String value, String secret) {
String result;
anonymous
anonymous / gist:1406238
Created November 29, 2011 20:09
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially