Skip to content

Instantly share code, notes, and snippets.

View michaeldeol's full-sized avatar

Michael Deol michaeldeol

View GitHub Profile
@rgranadino
rgranadino / ecs-ssh.rb
Last active February 16, 2018 18:12
AWS ECS ssh helper
#!/usr/bin/ruby
require 'json'
$sshUser = 'ec2user'
#NOTE all of our ecs clusters are prefixed with "ecs-"
#which we assume here to save the time & trouble of having to type that out
#all of our tasks are also suffixed with the "environment" name
def sshToEcsInstance(clusterName)
cmd = "aws ecs list-container-instances --cluster ecs-"+ clusterName
instances = JSON.parse(`#{cmd}`)["containerInstanceArns"]
ec2InstanceHostname = getInstanceInfo(clusterName, instances.sample)
@paulirish
paulirish / what-forces-layout.md
Last active May 24, 2024 19:16
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