Skip to content

Instantly share code, notes, and snippets.

// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@nilegfx-snippets
nilegfx-snippets / gist:1992675
Created March 7, 2012 11:44 — forked from html/gist:1698093
Sequential images loading with jquery
function eachStep(collection, callback, endcallback){
if(collection.length == 0){
return endcallback && endcallback();
}
jQuery.when(callback(collection[0])).always(function(){
eachStep(collection.slice(1), callback, endcallback);
});
}
@nilegfx-snippets
nilegfx-snippets / gist:1992323
Created March 7, 2012 09:58 — forked from benbenlijie/gist:1992300
jQuery: start
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
</head>
<body>
</body>
@nilegfx-snippets
nilegfx-snippets / gist:1992309
Created March 7, 2012 09:56 — forked from rudev/gist:1992277
CSS: Simple Modern CSS Grid
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<style>
.container {
width: 80%;
margin: auto;
overflow: hidden;