⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this function composes functions like in Haskell (and most other functional languages) | |
//the final composed function can accept parameters dictated by the chain it creates | |
//you can pass it a list of functions and it shall apply them from RIGHT to LEFT (right associativeness?) | |
//eg., c0(fn1, fn2, fn3)(10) => return fn1(fn2(fn3(10))); | |
// out<---<----<----<=10 | |
function c0(f, g) { | |
var last; | |
if (!arguments.length) return; | |
if (arguments.length === 1) return f; | |
if (arguments.length === 2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], | |
"ecmaFeatures": { |
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.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent