I commonly need to get a big list of all the stuff people think of when they think new and shiny these days. This list is for that.
I take a very inclusionist approach to it. 1
- Web Storage (localStorage, sessionStorage)
- Web SQL Database
// quick test for box-shadow support of inset and spread radius | |
// and datauri test | |
// boxshadow test needs other prefixes added. | |
var docElem = document.documentElement; | |
// if WebkitBoxShadow is supported at all then: | |
if (docElem.style.WebkitBoxShadow !== undefined) { /* basic support */ } |
// feature test for position fixed. | |
Modernizr.addTest('positionfixed', function () { | |
var test = document.createElement('div'), | |
control = test.cloneNode(false), | |
fake = false, | |
root = document.body || (function () { | |
fake = true; | |
return document.documentElement.appendChild(document.createElement('body')); | |
}()); |
// Modernizr lite, unofficial. ;) | |
// usage: | |
// | |
// testStyle('box-shadow') | |
// | |
// a class of `boxshadow` or `no-boxshadow` is added to the <html> element accordingly. | |
function testStyle(style){ |
// desire: localStorage and sessionStorage should accept objects | |
// in fact they do according to spec. | |
// http://code.google.com/p/chromium/issues/detail?id=43666 | |
// but so far that part isnt implemented anywhere. | |
// so we duckpunch set/getItem() to stringify/parse on the way in/out | |
// this seems to work in chrome | |
// but fails in FF (cant redefine setItem as a function, it just tostring's it) |
I commonly need to get a big list of all the stuff people think of when they think new and shiny these days. This list is for that.
I take a very inclusionist approach to it. 1
<!-- so it turns out that the object tag can act like an iframe | |
but the cool thing is you can nest object tags inside eachother for a fallback path. | |
what this means is you can "objectframe" a site.. and if it fails.. (site down, offline, whatever).. it'll use the next one. | |
so you can objectframe the live site and fallback to a screenshot. | |
or something. | |
demo at : http://jsfiddle.net/paul/CY2FQ/1/ | |
--> |
// ==UserScript== | |
// @name UTM param stripper | |
// @author Paul Irish | |
// @namespace http://github.com/paulirish | |
// @version 1.2 | |
// @description Drop the UTM params from a URL when the page loads. | |
// @extra Cuz you know they're all ugly n shit. | |
// @include http*://* | |
// ==/UserScript== |
// allow $('elem').css({ 'left' : '+=10px' }); | |
// so you dont need to do: | |
// $('elem').animate({ 'left' : '+=10px' }, 0); | |
// by paul irish | |
// for ralph holzmann | |
// http://github.com/paulirish/lazyweb-requests/issues#issue/10 |
$ = window.jQuery; | |
var html = '' + | |
' <form action="//www.instapaper.com/bookmarklet/post_v5" method="post" id="instapaper"> \ | |
<input type="hidden" name="p" value=""/> \ | |
<input type="hidden" name="b" id="b" value=""/> \ | |
</form>'; |
/* | |
.d dP"Yb dP"Yb 88""Yb .d .d dP"Yb 88""Yb .d oP"Yb. 888888 88 88 88 88b 88 dP""b8 .dP"Y8 | |
.d88 dP Yb dP Yb 88__dP .d88 .d88 dP Yb 88__dP .d88 "' dP' 88 88 88 88 88Yb88 dP `" `Ybo." | |
88 Yb dP Yb dP 88"Yb 88 88 Yb dP 88"Yb 88 dP' 88 888888 88 88 Y88 Yb "88 o.`Y8b | |
88 YbodP YbodP 88 Yb 88 88 YbodP 88 Yb 88 .d8888 88 88 88 88 88 Y8 YboodP 8bodP' | |
88 88 888888 db 88""Yb 88b 88 888888 8888b. 888888 88""Yb dP"Yb 8b d8 |