Skip to content

Instantly share code, notes, and snippets.

View montogeek's full-sized avatar

Fernando Montoya montogeek

View GitHub Profile
<pre>
<code>
module.exports = {
<ul> /* This would be rendered by the React component */
<li clas="default">production</>
<li>development</li>
<li>none</li>
</ul>
}
</code>
@montogeek
montogeek / what-forces-layout.md
Created August 2, 2017 05:21 — 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()
28014 silly linkStuff map-stream@0.1.0 has /Users/montogeek/eye-square/in-context-testing/context/apps/instagram/node_modules as its parent node_modules
28015 verbose linkBins map-stream@0.1.0
28016 verbose linkMans map-stream@0.1.0
28017 silly build camelcase-keys@2.1.0
28018 info linkStuff camelcase-keys@2.1.0
28019 silly linkStuff camelcase-keys@2.1.0 has /Users/montogeek/eye-square/in-context-testing/context/apps/instagram/node_modules as its parent node_modules
28020 verbose linkBins camelcase-keys@2.1.0
28021 verbose linkMans camelcase-keys@2.1.0
28022 silly build map-obj@1.0.1
28023 info linkStuff map-obj@1.0.1
0 info it worked if it ends with ok
1 verbose cli [ '/Users/montogeek/.nvm/versions/node/v8.0.0/bin/node',
1 verbose cli '/Users/montogeek/.nvm/versions/node/v8.0.0/bin/npm',
1 verbose cli 'install' ]
2 info using npm@5.0.0
3 info using node@v8.0.0
4 silly install runPreinstallTopLevelLifecycles
5 silly preinstall project@1.0.0
6 info lifecycle project@1.0.0~preinstall: project@1.0.0
7 silly lifecycle project@1.0.0~preinstall: no script for preinstall, continuing
0 info it worked if it ends with ok
1 verbose cli [ '/Users/montogeek/.nvm/versions/node/v7.7.4/bin/node',
1 verbose cli '/Users/montogeek/.nvm/versions/node/v7.7.4/bin/npm5',
1 verbose cli 'install' ]
2 info using npm@5.0.0-beta.46
3 info using node@v7.7.4
4 notice BETA npm5 is beta software. Please see https://github.com/npm/npm/issues/16510 for known issues, and please file a new one if you find something new.
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install loadIdealTree
async function getUsersData(regionCode) {
const promiseArray = getUsersIdList(regionCode).map(fetchUserData);
return Promise.all(promiseArray);
}
async function getPostsData(regionCode) {
const usersData = await getUsersData(regionCode);
const promiseArray = usersData
.map(getPostsIds)
function sumOfTwo(a, b, v) {
"strict mode"
const aSorted = a.sort((a, b) => a - b)
const bSorted = b.sort((a, b) => a - b)
for(var i = 0; i < aSorted.length; i++) {
for(var j = 0; j < bSorted.length; j++) {
if(aSorted[i] + bSorted[j] === v) {
return true
}

Keybase proof

I hereby claim:

  • I am montogeek on github.
  • I am montogeek (https://keybase.io/montogeek) on keybase.
  • I have a public key ASAfRFiU2dUOjEtuUNXnLkCyDNxdy4b8weo0NcuxTPFE0go

To claim this, I am signing this object:

[libs]
decls/.*

Keybase proof

I hereby claim:

  • I am montogeek on github.
  • I am montogeek (https://keybase.io/montogeek) on keybase.
  • I have a public key ASCSiZkOe3hB40QudAzJZzCHll-iiHKDJOuqYctrD67Vywo

To claim this, I am signing this object: