Skip to content

Instantly share code, notes, and snippets.

View anilGupta's full-sized avatar

Anil Gupta anilGupta

View GitHub Profile
@john-doherty
john-doherty / javascript-trim-svg-whitespace.js
Created October 21, 2016 13:39
Trim whitespace from SVG elements
function trimSvgWhitespace() {
// get all SVG objects in the DOM
var svgs = document.getElementsByTagName("svg");
// go through each one and add a viewbox that ensures all children are visible
for (var i=0, l=svgs.length; i<l; i++) {
var svg = svgs[i],
box = svg.getBBox(), // <- get the visual boundary required to view all children
@umpirsky
umpirsky / list.md
Last active April 23, 2021 10:10
Symfony e-commerce solutions.