Skip to content

Instantly share code, notes, and snippets.

View Damon4's full-sized avatar

Dmitry Schekotov Damon4

View GitHub Profile
@Damon4
Damon4 / what-forces-layout.md
Created May 7, 2022 10:31 — 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.

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
@Damon4
Damon4 / delete_git_submodule.md
Created December 16, 2020 12:04 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
#
## Created by iDamon4 on 17.11.2014.
#
gulp = require('gulp')
nib = require('nib')
g = require('gulp-load-plugins')()
g.urlAdjuster = require('gulp-css-url-adjuster')
gulpsync = require('gulp-sync')(gulp);
var PATH = {};
var RESOURSES = 'app/frontend/www/res/';
PATH.STATIC = RESOURSES;
PATH.B_PLATFORMS = RESOURSES+'img/b-platform';
PATH.BUILD = 'www/static/build/';
PATH.ASSETS = 'www/static/assets/';
PATH.JS = 'www/static/js/';
PATH.JS_BUILD = 'www/static/build/js/';
var gulp = require('gulp');
var urlAdjuster = require('gulp-css-url-adjuster');
var nib = require('nib');
var stylus = require('gulp-stylus');
var sourcemaps = require('gulp-sourcemaps');
var timestamp = Date.now();
// Get and render all .styl files recursively
gulp.task('stylus', function () {
var PATH = {};
var RESOURSES = 'app/frontend/www/res/';
PATH.STATIC = RESOURSES;
PATH.B_PLATFORMS = RESOURSES+'img/b-platform';
PATH.BUILD = 'www/static/build/';
PATH.ASSETS = 'www/static/assets/';
PATH.JS = 'www/static/js/';
PATH.JS_BUILD = 'www/static/build/js/';
var PATH = {};
var RESOURSES = 'app/frontend/www/res/';
PATH.STATIC = RESOURSES;
PATH.BUILD = 'www/static/build/';
PATH.ASSETS = 'www/static/assets/';
PATH.JS = 'www/static/js/';
PATH.JS_BUILD = 'www/static/build/js/';
PATH.CSS = RESOURSES+'css/';
var PATH = {};
var RESOURSES = 'app/frontend/www/res/';
PATH.STATIC = RESOURSES;
PATH.BUILD = 'www/static/build/';
PATH.ASSETS = 'www/static/assets/';
PATH.JS = 'www/static/js/';
PATH.JS_BUILD = 'www/static/build/js/';
PATH.CSS = RESOURSES+'css/';
{
"devDependencies": {
"grunt": "^0.4.5",
"grunt-borschik": "^1.0.0",
"grunt-browser-sync": "^1.1.2",
"grunt-contrib-clean": "^0.5.0",
"grunt-contrib-compass": "^0.9.0",
"grunt-contrib-imagemin": "^0.7.1",
"grunt-contrib-stylus": "^0.17.0",
"grunt-contrib-watch": "^0.6.1",
var PATH = {};
PATH.IMAGES = 'www/static/images/';
PATH.SPRITE = 'www/static/img/';
PATH.IMG = 'www/static/img/';
PATH.IMGMIN = 'www/static/img.min/';
PATH.CSS = 'www/static/css/';
PATH.STYLUS = 'www/static/stylus/';
path = require('path');
module.exports = function(grunt) {