This file contains 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
" copy all this into a vim buffer, save it, then... | |
" source the file by typing :so % | |
" Now the vim buffer acts like a specialized application for mastering vim | |
" There are two queues, Study and Known. Depending how confident you feel | |
" about the item you are currently learning, you can move it down several | |
" positions, all the way to the end of the Study queue, or to the Known | |
" queue. | |
" type ,, (that's comma comma) |
This file contains 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
/* | |
* Normalized hide address bar for iOS & Android | |
* (c) Scott Jehl, scottjehl.com | |
* MIT License | |
*/ | |
(function( win ){ | |
var doc = win.document; | |
// If there's a hash, or addEventListener is undefined, stop here | |
if( !location.hash && win.addEventListener ){ |
This file contains 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; } |
This file contains 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 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
/* | |
* 'rem' is a Sass mixin that converts pixel values to rem values for whatever property is passed to it. | |
* It returns two lines of code — one of the regular pixel values (for IE), and another with the | |
* converted rem values (for everyone else). Special thanks to Chris Epstein (http://chriseppstein.github.com) | |
* and Martin Bavio (http://martinbavio.com) for the help and code! | |
* | |
* Sample input: | |
* .element { | |
* @include rem('padding',10px 0 2px 5px); | |
* } |
This file contains 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
// <a rel="smoothscroll" href="#foo">got to foo</a> | |
// <div id="foo">Foo content</div> | |
$(function () { | |
$('a[rel=smoothscroll]').click(function( event ) { | |
var location = window.location, | |
hash = $(this).attr('href') | |
; | |
$('html, body') | |
.stop() | |
.animate({scrollTop: $(hash).offset().top}, 800, function () { |