Skip to content

Instantly share code, notes, and snippets.

View dbox's full-sized avatar

Daniel Box dbox

View GitHub Profile
@dbox
dbox / dabblet.css
Created May 2, 2012 15:21 — forked from chriscoyier/dabblet.css
Animate to natural width
/* Animate to natural width */
body { background: black; padding: 100px; margin: 0; }
.progress-bar {
border: 2px solid red;
border-radius: 14px;
}
.progress-bar > div {
@dbox
dbox / gist:2562297
Created April 30, 2012 20:08
Serve non-scalable meta for iPhone only (messes up on 2.3 Android)
$(document).ready(function() {
//Serve non-scalable meta for iPhone only (messes up on 2.3 Android)
var deviceAgent = navigator.userAgent.toLowerCase();
var agentID = deviceAgent.match(/(iphone|ipod)/);
if (agentID) {
$('head').append('<meta name="viewport" content="width=390, user-scalable=0;">');
}
onclick="window.open('aggregator.html');"
onClick="window.location.href='aggregator.html'"
@dbox
dbox / dabblet.css
Created April 18, 2012 18:11 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@dbox
dbox / gist:2414436
Created April 18, 2012 15:42
Twitter Spinner
.spinner {
background: transparent url(https://si0.twimg.com/twitter-mobile/0d70e1de0c3e78cea79a8f953985e5daeee29d67/html5/framework/core/assets/m_spinner_black.png?v=0d70e1de0c3e78cea79a8f953985e5daeee29d67) center 40% no-repeat;
-webkit-animation: spin 1s linear infinite;
-moz-animation: spin 1s linear infinite;
background-size: 19px 19px;
-webkit-background-size: 19px 19px;
-moz-background-size: 19px 19px;
display: inline-block;
width: 19px;
height: 19px;
@dbox
dbox / viewportwidth.js
Created April 12, 2012 18:14 — forked from rutger1140/viewportwidth.js
Display viewport width with jQuery
/**
* Display your window width - useful for responsive web design
* @author: Rutger Laurman
*/
// Ready?
$(function(){
// Create debug element
$("body").append("<div style='position:absolute;top:0;left:0;border:1px solid #999;background:#eee;' id='viewportwidth'></div>");