Skip to content

Instantly share code, notes, and snippets.

Fernando Montoya montogeek

View GitHub Profile
@montogeek
montogeek / 📊 Weekly development breakdown
Last active May 26, 2020
📊 Weekly development breakdown
View 📊 Weekly development breakdown
TypeScript 11 hrs 24 mins ████████████▉░░░░░░░░ 61.4%
JavaScript 3 hrs 35 mins ████░░░░░░░░░░░░░░░░░ 19.3%
JSON 2 hrs 45 mins ███░░░░░░░░░░░░░░░░░░ 14.9%
Docker 16 mins ▎░░░░░░░░░░░░░░░░░░░░ 1.5%
Other 11 mins ▏░░░░░░░░░░░░░░░░░░░░ 1.1%
View output.html
<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 Aug 2, 2017 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

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()
View debug.log
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
View debug.log
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
View debug.log
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
View code.js
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)
View test.js
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
}
You can’t perform that action at this time.