Skip to content

Instantly share code, notes, and snippets.

@antixrist
antixrist / what-forces-layout.md
Created February 1, 2018 08:04 — 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()
@antixrist
antixrist / myTransformation.js
Created December 14, 2017 08:52 — forked from Kukunin/myTransformation.js
A template for a typical transformation for gulp
const through = require('through2'),
PluginError = require('gulp-util').PluginError;
module.exports = function myTransformation(options) {
if(!options) {
options = {};
}
return through.obj(function (file, enc, cb) {
if (file.isNull()) {
@antixrist
antixrist / parsersissparta.md
Created May 29, 2017 10:00 — forked from obenjiro/parsersissparta.md
Parsers - is Sparta!
@antixrist
antixrist / gulpfile.js
Created April 13, 2016 13:42 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
#!/bin/bash
##############
echo "
//////////////////////////////////////
// //
// Welcome to MODx autoinstaller. //
// //
//////////////////////////////////////