Skip to content

Instantly share code, notes, and snippets.


Elliot Lewis elliotlewis

  • No Two The Same
  • London & Manchester
View GitHub Profile
paulirish /
Last active September 21, 2023 07:30
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
tonymtz / gist:d75101d9bdf764c890ef
Last active August 31, 2023 14:22
Uninstall nodejs from OSX Yosemite
View gist:d75101d9bdf764c890ef
# first:
lsbom -f -l -s -pf /var/db/receipts/ | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
brandonkelly /
Last active February 19, 2023 19:24
Templating in EE vs. Craft
TomByrne / MultiExporter.jsx
Last active September 12, 2023 21:38
An Illustrator script for exporting layers and/or artboards into separate files (PNG8 / PNG24 / EPS / PDF / SVG / JPG / FXG).See
View MultiExporter.jsx
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
// Copyright 2013 Tom Byrne
// Comments or suggestions to
croxton / Semantic responsive grids with CSS Crush.css
Last active April 8, 2018 01:29
Semantic resposive grids with CSS Crush
View Semantic responsive grids with CSS Crush.css
/* =============================================================================
========================================================================== */
@define {
grid-gutter: 30px;
small: min-width:36em;
medium: min-width:48em;
large: min-width:62.5em;
xlarge: min-width:75em;
siffring / .htaccess
Created March 4, 2012 17:33
htaccess to password protect a specific server
View .htaccess
# ----------------------------------------------------------------------
# Password protect staging server
# Use one .htaccess file across multiple environments
# (e.g. local, dev, staging, production)
# but only password protect a specific environment.
# ----------------------------------------------------------------------
SetEnvIf Host passreq
AuthType Basic
AuthName "Password Required"
manifestuk / Find EE Extension Hooks
Created January 14, 2012 01:15
Output a list of every extension hook for a given ExpressionEngine installation
View Find EE Extension Hooks
# Description:
# A couple of useful bash one-liners for finding all of the extension hooks in
# a given ExpressionEngine installation. Here's what it does:
# 1. Finds all of the native hooks, and any third-party hooks;
# 2. Sorts them alphabetically;
# 3. Outputs them to STDOUT or a file of your choosing.
# Usage:
# CD to the `/system/expressionengine/` directory of your site, and run
View config_bootstrap.php
* Custom configuration bootstrap file for ExpressionEngine
* Place config.php in your site root
* Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/config.php
* Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/database.php
* If you have moved your site root you'll need to update the require_once path