Skip to content

Instantly share code, notes, and snippets.

View garajo's full-sized avatar

GL garajo

View GitHub Profile
@garajo
garajo / what-forces-layout.md
Created December 18, 2018 16:06 — 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()
@garajo
garajo / nodejs-cheatsheet.js
Created September 13, 2018 17:55 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@garajo
garajo / App.js
Created August 21, 2018 00:50 — forked from mizchi/App.js
Minimum SSR
/* @flow */
import React from 'react'
export default function App(props: any) {
console.log('render App')
return (
<div>
<h1>{props.url}</h1>
</div>
)
@garajo
garajo / App.js
Created August 21, 2018 00:50 — forked from mizchi/App.js
Minimum SSR
/* @flow */
import React from 'react'
export default function App(props: any) {
console.log('render App')
return (
<div>
<h1>{props.url}</h1>
</div>
)
@garajo
garajo / Immutable JS Examples
Created August 17, 2018 05:32 — forked from singhshivam/Immutable JS Examples
Immutable JS Examples
List()
var list = Immutable.List([1,2,3])
// [1, 2, 3]
List.isList()
Immutable.List.isList(list)
// true
List.of()
var list = Immutable.List.of(1,2,3);
@garajo
garajo / typescript_cheatsheet.ts
Created August 9, 2018 17:25
Typescript Cheat Sheet - Syntax features and examples
// _____ __ _ _
///__ \_ _ _ __ ___/ _\ ___ _ __(_)_ __ | |_
// / /\/ | | | '_ \ / _ \ \ / __| '__| | '_ \| __|
// / / | |_| | |_) | __/\ \ (__| | | | |_) | |_
// \/ \__, | .__/ \___\__/\___|_| |_| .__/ \__|
// |___/|_| |_|
//Typescript Cheat Sheet: every syntax feature exemplified
//variables are the same as javascript, but can be defined with a type:
var myString:string;
@garajo
garajo / M&DLecture.txt
Created July 7, 2018 05:06 — forked from newswim/M&DLecture.txt
Douglas Crockford's Monads and Gonads
Monads / (mo problems)
Taken from Category Theory and imported into Haskell.
Has the strange quirk of being un-explainable.
The monad solves a particular problem that Haskell has
but it turns out to be a generally useful concept.
@garajo
garajo / M&DLecture.txt
Created July 7, 2018 05:06 — forked from newswim/M&DLecture.txt
Douglas Crockford's Monads and Gonads
Monads / (mo problems)
Taken from Category Theory and imported into Haskell.
Has the strange quirk of being un-explainable.
The monad solves a particular problem that Haskell has
but it turns out to be a generally useful concept.
@garajo
garajo / Subfolder to git repo.md
Created June 22, 2018 07:40 — forked from korya/Subfolder to git repo.md
Convert subfolder into Git submodule
@garajo
garajo / gist:bd8c9c780f19e9bcefb56a94b5d484ee
Created June 5, 2018 16:43 — forked from jagregory/gist:710671
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git