Skip to content

Instantly share code, notes, and snippets.

View mrmartineau's full-sized avatar
👋
Aho Young Warrior

Zander Martineau mrmartineau

👋
Aho Young Warrior
View GitHub Profile
@mrmartineau
mrmartineau / Fluidbox.markdown
Created December 29, 2013 17:40
A Pen by Terry.

Fluidbox

Replicating and improving the lightbox module seen on Medium with fluid transitions.

A Pen by Terry on CodePen.

License.

a {
transition: all .3s cubic-bezier(.3,2,.5,.8);
}
@mrmartineau
mrmartineau / getViewportDimensions.js
Last active November 18, 2017 22:26
Get viewport dimensions
/* ==========================================================================
Reliably get viewport dimensions
Notes:
relies on position:fixed support, but it should work in browsers that
partially support position: fixed like iOS4 and such...
Usage:
* $('.spotlight').css( getViewportDimensions() );
* $('.spotlight').css('height', getViewportDimensions().height);
@mrmartineau
mrmartineau / hidpi.css
Created June 30, 2014 19:43
hidpi media query
@media only screen and (-webkit-min-device-pixel-ratio: 1.3),
only screen and (min--moz-device-pixel-ratio: 1.3),
only screen and (-o-min-device-pixel-ratio: 1.3),
only screen and (min-resolution: 125dpi),
only screen and (min-resolution: 1.3dppx) {
/* Content goes below*/
}
@mrmartineau
mrmartineau / ebayListing.html
Last active February 11, 2017 09:57
Ebay css
<link href='http://fonts.googleapis.com/css?family=Karla:400,700' rel='stylesheet' type='text/css'>
<style>
.zmEbayContainer {
font-family: Karla, Helvetica Neue;
color: #2F353A;
width: 80%;
background-color: #f1f1f1;
margin: 50px auto;
padding: 35px 50px;
}
@mrmartineau
mrmartineau / index.js
Created August 26, 2015 11:40
Better DOMready
// This is needed to prevent onreadystatechange being run twice
var ready = false;
document.onreadystatechange = function() {
if (ready) {
return;
}
// interactive = DOMContentLoaded & complete = window.load
@mrmartineau
mrmartineau / googleAnalytics.html
Created March 11, 2016 16:30
Google Analytics embed code for Kickoff. http://trykickoff.com
<script>
(function(K,i,c,k,o,f,F){K['GoogleAnalyticsObject']=o;K[o]=K[o]||function(){
(K[o].q=K[o].q||[]).push(arguments)},K[o].l=1*new Date();f=i.createElement(c),
F=i.getElementsByTagName(c)[0];f.async=1;f.src=k;F.parentNode.insertBefore(f,F)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-XX', 'http://yourdomain.com', {
//'cookieDomain': 'none' // Use if debugging on localhost
});
ga('send', 'pageview');
@mrmartineau
mrmartineau / _module-naming-mixins.scss
Last active March 14, 2016 11:16
module naming mixins
@include component('foo') {
margin: auto;
@include modifier('bar') {
padding: 20px;
}
@include modifier('baz') {
padding: 50px;
@mrmartineau
mrmartineau / detects-flexbox.js
Created March 15, 2016 11:18 — forked from branneman/detects-flexbox.js
Feature detect Flexbox support with JavaScript
define(function() {
var cssomPrefixes = 'Moz O ms Webkit'.split(' ');
var modElem = {
elem: document.createElement('modernizr')
};
var mStyle = {
style: modElem.elem.style
};

Keybase proof

I hereby claim:

  • I am mrmartineau on github.
  • I am zander (https://keybase.io/zander) on keybase.
  • I have a public key whose fingerprint is B686 75C9 8088 B2AD 9B47 74EF 41F1 9641 16AF 831C

To claim this, I am signing this object: