Skip to content

Instantly share code, notes, and snippets.

@echenley
echenley / gplus.html
Last active August 13, 2016 14:54
Responsive Google Plus Widget
<div class="gp-wrap" id="gp-wrap">
<div class="g-page" data-href="https://plus.google.com/102226233421872956936" data-rel="publisher"></div>
<script type="text/javascript">
(function() {
// this guy right here
document.getElementsByClassName('g-page')[0].setAttribute('data-width', document.getElementById('gp-wrap').clientWidth);
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/platform.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
@echenley
echenley / _mixins.scss
Created March 11, 2015 19:15
Sass function to convert px to em. Add to _mixins.scss. Optional context parameter.
$base-font-size: 16px; // defined by bootstrap
@function em($target, $context: $base-font-size) {
@if $target == 0 { @return 0 }
@return $target / $context + 0em;
}
// font-size: em(36px);
// => font-size: 2.21875em