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> | |
<meta charset="utf-8"/> | |
<title>#jq140 template</title> | |
</head> | |
<body> | |
<h1>#jq140 template and rules</h1> | |
<ul> | |
<li>Submission must fit in a tweet, including '#jq140'. That's 134 characters of js.</li> |
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
/* | |
Many beginning jQuery people forget to save the results of a selection and | |
just call $('foo') over and over. The only time you would need to do that is if the | |
DOM changes. Otherwise you can just save the results somewhere when the | |
selection is first made. Much more performant. | |
Here's a mini jQuery plugin that just caches the results of a selector after | |
the first time it's invoked. | |
*/ |
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> | |
<title>Is this where web development is going?</title> | |
<script src="style.css.js"></script> | |
<script src="jquery.js"></script> | |
<script src="underscore.js"></script> | |
<script src="backbone.js"></script> | |
<script src="mustache.js"></script> | |
<script src="ICanHaz.js"></script> |
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($){ | |
window.util ={mousepos:{}}; | |
//Constantly tracks mouse position | |
$(document).bind('mousemove.util', function(e){ | |
//adapted from http://www.quirksmode.org/js/events_properties.html | |
if (!e) var e = window.event; | |
if (e.pageX || e.pageY) { | |
util.mousepos.left = e.pageX; | |
util.mousepos.top = e.pageY; | |
} |
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
/* | |
F'n Sweet Grid system | |
Reduced fluid version of http://960.gs with fixed-width gutters | |
No support for < IE8 | |
Basic usage: | |
In some stylesheet: | |
@include grid(); | |
In your html: | |
<div class="container"> | |
<div class="grid_4">4</div> |
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
.container{overflow:hidden;zoom:1;margin:0;padding:0} | |
.container > *{float:left;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;padding-left:10px} | |
.container > .alpha,.container > :first-child{padding-left:0!important} | |
.container > .grid_12{padding:0} | |
.grid_1{width:8.333%} | |
.grid_2{width:16.667%} | |
.grid_3{width:25%} | |
.grid_4{width:33.333%} | |
.grid_5{width:41.667%} | |
.grid_6{width:50%} |
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
//You can use jQuery deferreds as well as traditional callbacks | |
$.fn.wait = function (ms,callback){ | |
var dfd = $.Deferred(); | |
setTimeout(function(){ | |
dfd.resolve(); | |
},ms); | |
if(callback){ | |
dfd.done(callback); | |
} | |
return dfd.promise(); |
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
//OVERWRITING Underscore.js's templates | |
// By default, Underscore uses ERB-style template delimiters, change the | |
// following template settings to use alternative delimiters. | |
_.templateSettings = { | |
evaluate : /<%([\s\S]+?)%>/g, | |
interpolate : /<%=([\s\S]+?)%>/g, | |
escape : /<%-([\s\S]+?)%>/g | |
value : /<%@([\s\S]+?)%>/g // inserts value of a variable on the object or "" if undefined | |
}); |
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 $w = $(window); | |
function imageHolder() { | |
//Organize our thumbs | |
var iThumb = 1, firstImage; | |
$('#album-thumbs > ul > li').each(function() { | |
if(iThumb === 1) { | |
$(this).addClass('current'); |
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
// Adds Support for localStorage to IE5-IE7 using userData | |
// <http://msdn.microsoft.com/en-us/library/ms531424(VS.85).aspx> | |
// See also <http://caniuse.com/#feat=namevalue-storage> | |
if(typeof window.localStorage === 'undefined') (function () { | |
var userdataKey = 'localStorage', | |
userdata = document.createElement('b'); | |
userdata.style.display = 'none'; | |
userdata.style.behavior = 'url("#default#userData")'; |