Skip to content

Instantly share code, notes, and snippets.

View rmacy's full-sized avatar
✌️
Lovin life!

Ryan Macy rmacy

✌️
Lovin life!
View GitHub Profile
@rmacy
rmacy / jquery-code-example.js
Last active May 3, 2018 18:00
About function chaining in Javascript
$('#someElementId').removeClass('hidden').addClass('display');
@rmacy
rmacy / interacting-with-return-results.js
Last active May 5, 2018 19:55
About function chaining in javascript
let ourValue = [1, 2, 3, 4].map(val => val + 1).sort((a, b) => a > b);
@rmacy
rmacy / interacting-with-return-results.js
Created May 5, 2018 19:51
About function chaining in javascript
[1, 2, 3, 4].map(val => val + 1).filter((a, b) => a > b);
@rmacy
rmacy / what-forces-layout.md
Created April 24, 2019 01:16 — forked from paulirish/what-forces-layout.md
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.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()