Skip to content

Instantly share code, notes, and snippets.

View afryer's full-sized avatar

Anthony afryer

  • Between a rock and a hard place
View GitHub Profile
@afryer
afryer / 0_reuse_code.js
Created August 9, 2017 16:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// private method
// Wraps the HTML in a TAG, Tag is optional
// If the html starts with a Tag, it will wrap the context in that tag.
// doesn't ACTUALLY work
function wrap(xhtml, tag) {
// new approach
// createDocumentFragment
var docFrag = document.createDocumentFragment(),
dummy,
wrapTag;
@afryer
afryer / _pems.scss
Created May 31, 2013 20:38 — forked from mrdanadams/_pems.scss
Px to ems
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */
/* Default font size in pixels if not overridden. */
$baseFontSize: 16;
/* Convert PX units to EMs.
Ex: margin-right: pem(16);
*/
@function pem($pxval, $base: $baseFontSize) {
@return #{$pxval / $base}em;