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
// http://jquery14.com/day-010/jquery-1-4-hawtness-4-with-paul-irish | |
/*d8b .d88888b. d888 d8888 | |
Y8P d88P" "Y88b d8888 d8P888 | |
888 888 888 d8P 888 | |
8888 888 888 888 888 .d88b. 888d888 888 888 888 d8P 888 | |
"888 888 888 888 888 d8P Y8b 888P" 888 888 888 d88 888 | |
888 888 Y8b 888 888 888 88888888 888 888 888 888 8888888888 | |
888 Y88b.Y8b88P Y88b 888 Y8b. 888 Y88b 888 888 d8b 888 |
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
// http://jquery14.com/day-12/jquery-1-4-hawtness-5-with-paul-irish | |
/*d8b .d88888b. d888 d8888 | |
Y8P d88P" "Y88b d8888 d8P888 | |
888 888 888 d8P 888 | |
8888 888 888 888 888 .d88b. 888d888 888 888 888 d8P 888 | |
"888 888 888 888 888 d8P Y8b 888P" 888 888 888 d88 888 | |
888 888 Y8b 888 888 888 88888888 888 888 888 888 8888888888 | |
888 Y88b.Y8b88P Y88b 888 Y8b. 888 Y88b 888 888 d8b 888 |
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
// original (http://html5shiv.googlecode.com/svn/trunk/html5.js) | |
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,figure,figcaption,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})() | |
// kangax version (29 characters less, yay!) | |
/*@cc_on(function(e,i){i=e.length;while(i--)document.createElement(e[i])})("abbr,article,aside,audio,canvas,datalist,details,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','))@*/ | |
// jdalton version (was 5, now 41 characters less than kangax, yay!) |
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
// uniqueifying strings | |
arr = 'group1,group2,group1,group4'.split(','); | |
$.map(arr, function(v,i){ return $.inArray(v,arr)!=i ? null : v }); | |
// w regex | |
'group1,group2,group1,group4'.replace(/((^|,)([^,]+).*),\3(?=,|$)/g, '$1') | |
/by temp01 |
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 (undefined) { | |
function detectMutation() { | |
mutationSupported = true; | |
this.removeEventListener('DOMAttrModified', detectMutation, false); | |
} | |
var forEach = [].forEach, | |
regex = /^data-(.+)/, | |
el = document.createElement('div'), | |
mutationSupported = 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
// jQuery.support.(displayTable|displayTableCell|margin0auto|positionFixed) | |
// jQuery.support.displayTable and displayTableCell - | |
// to determine browser support for setting elements to that css display value | |
$.each(['','-cell'],function(k,v){ | |
$.support['displayTable'+v.replace('-c','C')] = (function(){ | |
var elem = $('<div>',{ | |
css : { | |
display: 'table'+v, |
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
// mousewheel normalization. | |
// taken from http://html5readiness.com/js/script.js - cheers paul! | |
$(document).bind('DOMMouseScroll mousewheel', function(e, delta) { | |
delta = delta || (e.detail && -e.detail/3) || (e.wheelDelta && e.wheelDelta/120); | |
}); | |
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
''' | |
getTwitterHistory. | |
mostly written by Simon Willison (ithink?) and fucked with by paul irish | |
1. set the credentials correctly below | |
2. run: python gethistory.py | |
''' | |
import urllib2 |
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
// fixing The Mysterious Firefox setTimeout "Lateness" argument™ | |
// by paul irish | |
// detail: http://benalman.com/news/2009/07/the-mysterious-firefox-settime/ | |
// "feature" test | |
void setTimeout(function(){ | |
if (arguments.length==1){ // bad mozilla!, bad! | |
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
// Idea from http://dbaron.org/log/20100424-any | |
jQuery.expr[':'].any = function(el, i, match) { | |
return jQuery.find.matches(match[3], [el]).length > 0; | |
}; | |
jQuery('body :any(div, form) p'); // Same as jQuery('body div p, body form p') | |
jQuery('div:any(.foo,.bar)'); // Same as jQuery('div.foo, div.bar') |