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 / themes.html
Created January 20, 2017 06:56
From my blog post: Creating dynamic layouts with Jekyll
<style>
.hero {
background-color: {{ page.style.color.primary }};
color:{{ page.hero.color }};
background-image: url({{ site.assets.imgPath }}{{ page.hero.bg }}?w=500&{{ site.assets.params }});
}
.hero-title {
color: {{ page.hero.color }};
}
.hero-link {
@mrmartineau
mrmartineau / front-matter.yml
Last active January 20, 2017 06:56
From my blog post: Creating dynamic layouts with Jekyll
# ------------ #
# Main content #
# ------------ #
partials:
- name: section-video
id: 183025668
spaced: true
- name: section
title: A wide-ranging audience. One unifying idea.
body: |
@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 / 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 / gist:2717799
Created May 17, 2012 09:41 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) {
$(document).ready(function () {
$('label[for]').click(function () {
var el = $(this).attr('for');
if ($('#' + el + '[type=radio], #' + el + '[type=checkbox]').attr('selected', !$('#' + el).attr('selected'))) {
return;
} else {
$('#' + el)[0].focus();
}
});
@mrmartineau
mrmartineau / rAF.js
Created July 24, 2012 10:23 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@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
};
Verifying my Blockstack ID is secured with the address 1yEg3gcmHZtHZp2eoFy8UocU3H8dxuKPh https://explorer.blockstack.org/address/1yEg3gcmHZtHZp2eoFy8UocU3H8dxuKPh
@mrmartineau
mrmartineau / getViewportSize.js
Created April 15, 2012 14:26 — forked from scottjehl/getViewportSize.js
Reliably get viewport dimensions in JS
/*!
An experiment in getting accurate visible viewport dimensions across devices
(c) 2012 Scott Jehl.
MIT/GPLv2 Licence
*/
function viewportSize(){
var test = document.createElement( "div" );
test.style.cssText = "position: fixed;top: 0;left: 0;bottom: 0;right: 0;";