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 / index.js
Last active March 11, 2022 04:54
vue-magnific. Magnific-popup wrapper for Vue.js
const _ = require('lodash');
const $ = require('jquery');
const Vue = require('vue');
require('jquery.magnific-popup');
module.exports = Vue.extend({
template: require('./tpl.html'),
props: {
show: {
type: Boolean,
@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));
@antixrist
antixrist / gist:faf300eb04c1aeca9137
Created August 10, 2014 09:10
VK API: Parse json Args to array.
/**
* For check: https://vk.com/dev/execute
*/
// var myList = Args.list;
// var listSeparator = Args.listSeparator;
// var listItemsType = Args.listItemsType;
var myList = "123456,789012,345678,901234,567890";
#!/bin/bash
##############
echo "
//////////////////////////////////////
// //
// Welcome to MODx autoinstaller. //
// //
//////////////////////////////////////
@antixrist
antixrist / gist:8556648
Created January 22, 2014 10:37
Bookmarklet бесконечной прокрутки для photosight.ru
(function(window, document, $, undefined){
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
var container = '.photolist';
var pageNext = '.g-paginator-next';
var pageList = '.pageslist';
var currentPageClass = 'current';
var $container = $(container);
var $pageNext = $(pageNext);
var $pageList = $(pageList);