Skip to content

Instantly share code, notes, and snippets.

View johnsardine's full-sized avatar

João Sardinha johnsardine

View GitHub Profile
@johnsardine
johnsardine / ms.js
Created December 21, 2011 02:01 — forked from rauchg/ms.md
Milliseconds conversion utility.
/**
# ms.js
No more painful `setTimeout(fn, 60 * 4 * 3 * 2 * 1 * Infinity * NaN * '☃')`.
ms('2d') // 172800000
ms('1.5h') // 5400000
ms('1h') // 3600000
ms('1m') // 60000
@johnsardine
johnsardine / dabblet.css
Created December 21, 2011 16:08 — forked from chriscoyier/dabblet.css
Checkbox Hack
/* Checkbox Hack */
input[type=checkbox] {
position: absolute;
top: -9999px;
left: -9999px;
}
label {
-webkit-appearance: push-button;
-moz-appearance: button;
@johnsardine
johnsardine / dabblet.css
Created March 19, 2012 11:59 — forked from JoelBesada/dabblet.css
CSS States
/* CSS States */
body {
background: url(http://dabblet.com/img/noise.png);
background-color: #F5F2F0;
font-family: Georgia, serif;
font-size: 18px;
line-height: 1.6em;
text-shadow: 0 2px 0 white;
color: #222;
}
@johnsardine
johnsardine / dabblet.css
Created April 19, 2012 15:26 — 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;
@johnsardine
johnsardine / dabblet.css
Created April 21, 2012 13:54 — forked from LeaVerou/dabblet.css
Image interpolation demo
/* Image interpolation demo */
@keyframes browsers {
from, to { background-image: url('http://lea.verou.me/css-4d/img/firefox-logo.png'); }
20% { background-image: url('http://lea.verou.me/css-4d/img/chrome-logo.png'); }
40% { background-image: url('http://lea.verou.me/css-4d/img/safari-logo.png'); }
60% { background-image: url('http://lea.verou.me/css-4d/img/opera-logo.png'); }
80% { background-image: url('http://lea.verou.me/css-4d/img/ie-logo.png'); }
}
@johnsardine
johnsardine / dabblet.css
Created June 5, 2012 20:07 — forked from LeaVerou/dabblet.css
drop-shadow filter vs box-shadow
/**
* drop-shadow filter vs box-shadow
*/
html {
background: url('http://subtlepatterns.com/patterns/purty_wood.png')
}
.speech-bubble {
position: relative;
@johnsardine
johnsardine / dabblet.css
Created June 11, 2012 21:43 — forked from LeaVerou/dabblet.css
CSS Pebbles!
/**
* CSS Pebbles!
*/
html {
background: url("http://michaeliahotel.com/img/sand.jpg");
min-height: 100%;
}
.aside-icons {
@johnsardine
johnsardine / dabblet.css
Created June 19, 2012 08:01 — forked from LeaVerou/dabblet.css
CSS Pebbles!
/**
* CSS Pebbles!
*/
html {
background: url("http://michaeliahotel.com/img/sand.jpg");
min-height: 100%;
}
.aside-icons {
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="yes" name="apple-mobile-web-app-capable">
<title>iOS Web App</title>
<!-- iPhone -->