Skip to content

Instantly share code, notes, and snippets.

View nathangross's full-sized avatar

Nathan Gross nathangross

View GitHub Profile
@jacurtis
jacurtis / _spacing-helpers.scss
Last active April 21, 2025 02:28
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@mannieschumpert
mannieschumpert / enqueue.php
Last active December 31, 2015 04:29
Optionally enqueue LiveReload for local development.
<?php
/**
* Enqueue LiveReload if local install
*
* Assumes livereload.js is in the root folder of your local site
*
* This should be fairly reliable,
* but may need to be changed for some environments
*/
@larrybotha
larrybotha / A.markdown
Last active May 1, 2025 17:28
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

class="[a-zA-Z0-9:;\.\s\(\)\-\,]*"