Skip to content

Instantly share code, notes, and snippets.

View Stanley's full-sized avatar

Stanisław Wasiutyński Stanley

View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active May 23, 2024 14:12
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.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@steveklabnik
steveklabnik / plain_language.txt
Created March 9, 2012 01:54
Hypermedia benefits in plain language
Hypermedia designs scale better, are more easily changed and promote decoupling
and encapsulation, with all the benefits those things bring. On the downside,
it is not necessarily the most latency-tolerant design, and caches can get stale
if you're not careful. It may not be as efficient on an individual request level
as other designs.
@max-mapper
max-mapper / couch-transform.js
Created January 14, 2012 02:27
streaming functional transformer for couchdb using node
var request = require('request').defaults({json: true}),
transfuse = require('transfuse'),
JSONStream = require('JSONStream');
function transform(couchdb, funcString, headers) {
var down = request({url: couchdb + '/_all_docs?include_docs=true'}),
up = request({url: couchdb + '/_bulk_docs', method: "POST", headers: headers}),
tr = transfuse(['rows', /./, 'doc'], funcString, JSONStream.stringify("{\"docs\":[\n", "\n,\n", "\n]}\n"));
down.pipe(tr)
tr.pipe(up)
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@carsonmcdonald
carsonmcdonald / gist:911761
Created April 9, 2011 20:48
node.js SPDY proxy
var tls = require('tls');
var fs = require('fs');
var Buffer = require('buffer').Buffer;
var zlib = require('zlib');
var BufferList = require('bufferlist');
var Binary = require('bufferlist/binary');
var Put = require('put');
var http = require('http');
var options =
@chrisjacob
chrisjacob / README.md
Created February 18, 2011 03:44
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result