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
# hack jQuery to use requestAnimationFrame for animations | |
((win, $)-> | |
# use Modernizr to get the (prefixed)DOM method | |
raf = Modernizr.prefixed('requestAnimationFrame', win) | |
if not raf | |
return | |
animating = false; | |
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(Modernizr, window) { | |
Modernizr.addTest('positionfixed', function () { | |
var ret; | |
// no (solid) support on <Android2 and <iOS4 | |
var ua = navigator.userAgent; | |
if(ua.match(/android [0-2]/i) || ua.match(/(iphone|ipad|ipod).+(OS [0-4])/i)) { | |
return false; | |
} |
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
/** | |
* triggers a callback when an element gets into the viewport | |
* uses a little bit of jQuery. elements auto receive the class `inview` | |
* | |
* the threshold parameter is on scale from 0 to 1 of the height. | |
* 0 means it triggers directly, 1 means it must be full visible | |
* | |
* @example | |
* // images needs to be 50% in view | |
* inview.register("img", .5, function(item, inview_state) { |
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
/** | |
* @example | |
* div.slideshow | |
* div first pane | |
* div.active active pane | |
* div last pane | |
*/ | |
.slideshow { | |
position: relative; | |
overflow: hidden; |
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
var IE = (function() { | |
if (document.documentMode) { | |
return document.documentMode; | |
} else { | |
for (var i = 7; i > 4; i--) { | |
var div = document.createElement("div"); | |
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->"; | |
if (div.getElementsByTagName("span").length) { |
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
// SmoothScroll for websites v1.2.1 | |
// Licensed under the terms of the MIT license. | |
// People involved | |
// - Balazs Galambosi (maintainer) | |
// - Michael Herf (Pulse Algorithm) | |
(function(){ | |
// Scroll Variables (tweakable) |
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
/** | |
* Prevent click events after a touchend. | |
* | |
* Inspired/copy-paste from this article of Google by Ryan Fioravanti | |
* https://developers.google.com/mobile/articles/fast_buttons#ghost | |
* | |
* USAGE: | |
* Prevent the click event for an certain element | |
* ```` | |
* PreventGhostClick(myElement); |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<h1>input[type="calc"]</h1> |
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(jQuery) { | |
if(!jQuery) { | |
return; | |
} | |
var $version = jQuery.prototype.jquery; | |
/** | |
* find out if a version number is greater then or equal (>=) as the compare version | |
* @example |
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
#!/usr/bin/env python | |
# execute in the folder you want the server to run | |
# starts at port 80 | |
import os | |
import urlparse | |
import SimpleHTTPServer | |
import SocketServer |
OlderNewer