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 / 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 / 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 / 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 / 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);
a {
transition: all .3s cubic-bezier(.3,2,.5,.8);
}
@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.

@mrmartineau
mrmartineau / string.substitute.js
Last active December 31, 2015 03:19
String.substitute and example used on the uk.thebar.com
String.prototype.substitute = function (object) {
return this.replace(/\{(.+?)\}/g, function (match, name) {
return name in object ? object[name] : match;
});
};
@mrmartineau
mrmartineau / bower.json
Created October 16, 2013 11:31
Kickoff bower example if not using jQuery
{
"name": "kickoff",
"version": "1.0.0",
"dependencies": {
"bean": "*",
"bonzo": "*",
"qwery": "*",
"lodash": "*",
"domready": "*"
},
- child element
e.g. .form-controlGroup > .form-controlGroup-label
-- modifier element
e.g. .btn.btn--primary
.is- element state
e.g. .btn.btn--primary
aB camel-case descriptors
@mrmartineau
mrmartineau / Kickoff components
Last active December 24, 2015 09:09
Example usage for Kickoff's components
Example usage for Kickoff's components