This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// data uri test. | |
// https://github.com/Modernizr/Modernizr/issues/14 | |
// This test is ascynchronous. Watch out. | |
(function(){ | |
var datauri = new Image(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define a couple of functions to make things a bit cleaner | |
var lowercase = function(string){ | |
return isString(string) ? string.toLowerCase() : string; | |
}; | |
function isString(value){ | |
return typeof value == 'string'; | |
} | |
// test for the major version of IE | |
var msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From http://blog.hull.io/post/46243434040/introducing-sass-getunicode | |
'☃'.charCodeAt(0).toString(16); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* List Prefix' | |
*/ | |
html { | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
font-family: Helvetica Neue; | |
font-weight: 100; | |
letter-spacing: .1em; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create and use an rvm gemset | |
rvm --rvmrc --create ruby-1.9.3@myProject | |
# Set the rvm as trusted | |
rvm rvmrc trust . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function smoothScroll(el, to, duration) { | |
if (duration < 0) { | |
return; | |
} | |
var difference = to - $(window).scrollTop(); | |
var perTick = difference / duration * 10; | |
this.scrollToTimerCache = setTimeout(function() { | |
if (!isNaN(parseInt(perTick, 10))) { | |
window.scrollTo(0, $(window).scrollTop() + perTick); | |
smoothScroll(el, to, duration - 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testWebP(callback) { | |
var webP = new Image(); | |
webP.src = 'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA'; | |
webP.onload = webP.onerror = function () { | |
callback(webP.height === 2); | |
}; | |
}; | |
function notify(supported) { | |
console.log((supported) ? "webP supported!" : "webP not supported."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert -delay 20 -loop 0 source*.gif final.gif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pre { | |
white-space: pre; /* CSS 2.0 */ | |
white-space: pre-wrap; /* CSS 2.1 */ | |
white-space: pre-line; /* CSS 3.0 */ | |
white-space: -pre-wrap; /* Opera 4-6 */ | |
white-space: -o-pre-wrap; /* Opera 7 */ | |
white-space: -moz-pre-wrap; /* Mozilla */ | |
white-space: -hp-pre-wrap; /* HP Printers */ | |
word-wrap: break-word; /* IE 5+ */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
An attempt at fixing the dreaded iOS orientationchange zoom bug http://adactio.com/journal/5088/. Seems to work! | |
Authored by @scottjehl | |
MIT License. | |
*/ | |
(function(w){ | |
var doc = w.document; | |
if( !doc.querySelectorAll ){ return; } |