Skip to content

Instantly share code, notes, and snippets.

View cperryk's full-sized avatar

Chris Kirk cperryk

View GitHub Profile
@cperryk
cperryk / new.yaml
Created June 7, 2017 18:37
fallback.yaml
components:
layout:
instances:
article:
head: head
main: main
bottom:
-
_ref: /components/ad/instances/thecut-bottomLeaderboardDesktopArticle
-
@cperryk
cperryk / gist:2d3250acac8a92a57aac
Last active September 30, 2015 19:32
Resize SVG height to fit contents using jQuery
function sizeSVG($svg){
var max_x = 0;
$svg.find('*').each(function(){
var bounding_rect = $(this)[0].getBoundingClientRect();
var x2 = bounding_rect.top + bounding_rect.height;
if(x2 > max_x){
max_x = x2;
}
});
$svg.css('height', max_x);