Skip to content

Instantly share code, notes, and snippets.

View m0nkey's full-sized avatar

Jesse Heady m0nkey

View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active July 17, 2025 11:38
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
@mediaupstream
mediaupstream / jekyll-deploy.sh
Created November 19, 2015 10:34
Jekyll website deploy script, using scp
#!/bin/bash
user="username"
host="example.com"
port=22
site_folder="_site"
remote_folder="/var/www/example.com/"
scp -P $port -r ${site_folder}/* ${user}@${host}:${remote_folder}
@brandondurham
brandondurham / styles.less
Last active June 24, 2024 14:48
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
@UndefinedOffset
UndefinedOffset / nr-deploy-post-merge-hook.sh
Last active July 9, 2021 10:19
A simple git deploy hook for notifying New Relic of deployments, it assumes that the base folder name of the repository is the application name. To set git to use this script you simply add this file into your .git/hooks folder as "post-merge".
#!/bin/bash
#New Relic API Key see https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/api-key#creating
NR_API_KEY="INSERT_API_KEY_HERE"
#Find New Relic App Name, if your top level folder is not the name of your application change the below two lines to simply NR_APP_NAME="MY_APP_NAME".
NR_APP_NAME=$(git rev-parse --show-toplevel)
NR_APP_NAME=$(basename "$NR_APP_NAME")
#Get the current git branch
@renatorib
renatorib / operator_with_ligatures.md
Last active January 11, 2024 06:45
Using Operator Mono with Fira Code ligatures in Atom.

Using Operator Mono with Fira Code ligatures in Atom.

  1. Open your Atom's Stylesheet
    image

  2. Put this css

atom-text-editor {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
@fIa5h
fIa5h / AMI_NR.js
Last active April 22, 2020 17:05
Ryan & Bruce
/*
New Relic GPT ad monitoring code
//
This snippet captures PageActions containing references to Google publisher tag ads
Should you have any questions about this, please reach out to me at [email protected]
Please note that you must be using New Relic's SPA browser agent.
//
*/
//
//first, make sure the newrelic object exists properly
@miguelmota
miguelmota / webdriver_full_page_screenshots.js
Last active May 3, 2023 04:56
Selenium Webdriver Node.js take screenshots of entire page
var webdriver = require('selenium-webdriver')
var assert = require('assert')
var fs = require('fs')
// Input capabilities
var capabilities = {
'browserName' : 'Chrome',
'browser_version' : '66.0',
'os' : 'Windows',
'os_version' : '10',