🎭 Jester gist stars for paulirish
A♦
what-forces-layout.md8295 stars

What forces layout/reflow. The comprehensive list.

# What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or [layout thrashing](http://www.kellegous.com/j/2013/01/26/layout-performance/), and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

### Element APIs

##### Getting box metrics
* `elem.offsetLeft`, `elem.offsetTop`, `elem.offsetWidth`, `elem.offsetHeight`, `elem.offsetParent`
* `elem.clientLeft`, `elem.clientTop`, `elem.clientWidth`, `elem.clientHeight`
* `elem.getClientRects()`, `elem.getBoundingClientRect()`
A♦
K♣
bling.js1947 stars

bling dot js

/* bling.js */

window.$ = document.querySelectorAll.bind(document);

Node.prototype.on = window.on = function (name, fn) {
  this.addEventListener(name, fn);
};

NodeList.prototype.__proto__ = Array.prototype;

NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) {
  this.forEach(function (elem, i) {
K♣
Q♥
rAF.js1620 stars

requestAnimationFrame polyfill

// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating

// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel

// MIT license

(function() {
    var lastTime = 0;
    var vendors = ['ms', 'moz', 'webkit', 'o'];
    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
        window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
Q♥
J♠
how-to-view-source-of-chrome-extension.md651 stars

How to view-source of a Chrome extension

## Option 1: Command-line download extension as zip and extract

```sh
extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"
```

Thx to crxviewer for the [magic download URL](https://github.com/Rob--W/crxviewer/blob/6113c25e3569e1ec59365ad9a177aa97e2bcda61/src/cws_pattern.js#L27-L74). 

## Option 2: Use the CRX Viewer website 
J♠
十♦
how to screencapture and make animated gifs or whathaveyou.md303 stars

Screencapture and animated gifs

# Screencapture and animated gifs

> I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then [LICEcap](http://www.cockos.com/licecap/) is a good solution).

## Capturing (Easy)

1. Launch quicktime player
1. do Screen recording

![screen shot 2014-10-22 at 11 16 23 am](https://cloud.githubusercontent.com/assets/39191/4741576/9745687c-5a17-11e4-8940-b47b4f9c52be.png)

1. hit the button
十♦
9♣
data-markdown.user.js287 stars

*[data-markdown] - use markdown, sometimes, in your HTML

// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==


// If you're not using this as a userscript just delete from this line up. It's cool, homey.

(function boom(){
  
9♣
8♥
gistfile1.md187 stars

a brief history of detecting local storage

A timeline of the last four years of detecting good old `window.localStorage`.

<hr>

#### Jan Lenhart, bless his heart contributed the first patch for support:

October 2009:
[5059daa](https://github.com/Modernizr/Modernizr/commit/5059daa4674651cd1adc39d902e4f4afa73426cd#L0R413)

```js
(typeof window.localStorage != 'undefined')
```
8♥
7♠
gistfile1.md133 stars

Learn JavaScript concepts with recent DevTools features

# Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin	, Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

## Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

```js
function A(a, b, c) {
7♠
6♦
readme.md131 stars

resolving the proper location and line number through a console.log wrapper

## console.log wrap resolving for your wrapped console logs

I've heard this before:

> What I really get frustrated by is that I cannot wrap `console.*` and preserve line numbers

We enabled this in Chrome DevTools via [blackboxing](https://developer.chrome.com/devtools/docs/blackboxing) a [bit ago](https://code.google.com/p/chromium/issues/detail?id=267592#c36).  

If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.


You can try it out here: http://plnkr.co/edit/3wg4u9HUGXfFH0U7MR7j
6♦
5♣
performance.now()-polyfill.js96 stars

performance.now() polyfill (aka perf.now())

// @license http://opensource.org/licenses/MIT
// copyright Paul Irish 2015


// Date.now() is supported everywhere except IE8. For IE8 we use the Date.now polyfill
//   github.com/Financial-Times/polyfill-service/blob/master/polyfills/Date.now/polyfill.js
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values

// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed

5♣
4♥
gistfile1.md90 stars

Open Conference Expectations


# Open Conference Expectations

This document lays out some baseline expectations between conference speakers and conference presenters. The general goal is to maximize the value the conference provides to its attendees and community and to let speakers know what they might reasonably expect from a conference. 

We believe that *all* speakers should reasonably expect these things, not just speakers who are known to draw large crowds, because no one is a rockstar but more people should have the chance to be one. We believe that conferences are better -- and, dare we say, more diverse -- when the people speaking are not just the people who can afford to get themselves there, either because their company paid or they foot the bill themselves. Basically, this isn't a rock show rider, it's some ideas that should help get the voices of lesser known folks heard.

These expectations should serve as *a starting point for discussion between speaker and organizer*. They are not a list of demands
4♥
3♠
utmstrip.user.js86 stars

userscript: Drop the UTM params from a URL when the page loads

// ==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==


// Update: 
3♠
2♦
README.md72 stars

imagesLoaded() jquery plugin

# this project has moved

## check out [github.com/desandro/imagesloaded](https://github.com/desandro/imagesloaded)
2♦
A♦
gistfile1.md71 stars

I wrote this in early January 2012, but never finished it. The research and thinking in this area led to a lot of the design of [Yeoman](http://yeoman.io) and talks like ["Javascript Development Workflow of 2013"](http://www.youtube.com/watch?v=f7AU2Ozu8eo), ["Web Application Development Workflow"](http://www.youtube.com/watch?v=vDbbz-BdyYc) and ["App development stack for JS developers"](https://vimeo.com/40929961) (surpisingly little overlap in those talks, btw).

Now it's June 2013 and the state of web app tooling has matured quite a bit. But here's a snapshot of the story from 18 months ago, even if a little ugly and incomplete. :p

<hr>

# In the beginning…


* Intro to tooling 
* build a picture of how it takes you from handcraft vs craftsman
A♦
K♣
gistfile1.js62 stars

html5 geolocation with fallback.

// geo-location shim

// currentely only serves lat/long
// depends on jQuery

// doublecheck the ClientLocation results because it may returning null results

;(function(geolocation){

  if (geolocation) return;
  
  var cache;
K♣
Q♥
args.gn42 stars

How to build Chromium to hack on DevTools

# Build arguments for the gn build
# You can set these with `gn args out/Default`
#   ( and they're stored in src/out/Default/args.gn )
# See "gn args out/Default --list" for available build arguments

# component build, because people love it
is_component_build = true

# release build, because its faster
 is_debug = true

# native client? no thx. (still needed in march 2023.)
Q♥
J♠
detect IE and version number through injected conditional comments.js40 stars

//EnhanceJS isIE test idea

//detect IE and version number through injected conditional comments (no UA detect, no need for cond. compilation / jscript check)

//version arg is for IE version (optional)
//comparison arg supports 'lte', 'gte', etc (optional)

function isIE(version, comparison) {
	var cc      = 'IE',
	    b       = document.createElement('B'),
	    docElem = document.documentElement,
	    isIE;
J♠
十♦
gistfile1.js38 stars

// everyone's new favorite closure pattern:
(function(window,document,undefined){ ... })(this,this.document);

// when minified:
(function(w,d,u){ ... })(this,this.document);

// which means all uses of window/document/undefined inside the closure 
// will be single-lettered, so big gains in minification.

// it also will speed up scope chain traversal a tiny tiny little bit.
// additionally it protects against the case where someone does `undefined = true`
十♦
9♣
gistfile1.html33 stars

<!DOCTYPE html> 

<!-- Helpful things to keep in your <head/> 
  // Brian Blakely, 360i 
  // http://twitter.com/brianblakely/  
-->
  <head>
    
    <!-- According to Heather Champ, former community manager at flickr,
         you should not allow search engines to index your "Contact Us"
         or "Complaints" page if you value your sanity. This is an HTML-
         centric way of achieving that. -->
9♣
8♥
gistfile1.js32 stars

jquery invert

// jquery invert plugin
// by paul irish

// some (bad) code from this css color inverter
//    http://plugins.jquery.com/project/invert-color
// some better code via Opera to inverse images via canvas
//    http://dev.opera.com/articles/view/html-5-canvas-the-basics/#insertingimages
// and some imagesLoaded stuff from me
//    http://gist.github.com/268257

// the code is still pretty shit. 
// needs better hex -> rgb conversion..
8♥
7♠
gistfile1.js22 stars


// selectorSupported lovingly lifted from the mad italian genius, diego perini
// http://javascript.nwbox.com/CSSSupport/
function selectorSupported(selector){
  
  var support, link, sheet, doc = document,
      root = doc.documentElement,
      head = root.getElementsByTagName('head')[0],

      impl = doc.implementation || {
              hasFeature: function() {
                  return false;
7♠
6♦
0readme.md22 stars

For converting adium logs to decently sexy HTML

# adium log export to HTML

this shit is for exporting this weirdass xml out into some sane HTML.

* run rename.sh to kill the whitespaces in your xml filenames
  * alternatively fix my htmlify.sh to not break on whitespace'd filenames
    * UPDATE: check [this comment](https://gist.github.com/1161725#gistcomment-73115) on a quick fix to avoid this rename script. BOOM! thx @kwef!
* run htmlify.sh
  * htmlify has a hardcoded destination directory.
  * htmlify also expects the format-html.* files to be up one folder from it.
* enjoy a bigass directory of all your logs all together with ugly filenames but at least they have nice styles and happy markup.
6♦
5♣
zIndex-bookmarklet.js19 stars

find all elements with a z-index and indicate what they are.

// find all elements with a z-index and indicate what they are.
// uses css outline which is not supported in IE <8

function contrast(color){ return '#' + 
   (Number('0x'+color.substr(1)).toString(10) > 0xffffff/2 ? '000000' :  'ffffff'); 
}

jQuery('*')
    .filter(function(){ return $(this).css('zIndex') !== 'auto'; })
    .each(function(){
         var color = '#'+Math.floor(Math.random()*16777215).toString(16); // <3 temp01
		 
5♣
4♥
webfont-performance-notes.md19 stars

webfont performance notes

Just jotting some notes on delivering webfonts performantly…

still an incomplete draft.

## Any critical fonts must be requested asap.

Critical fonts are neccessary for the above-the-fold content to be useful. Identify which of the fonts you NEED for the first render, as they get very different treatment vs the others.

You want the network reqs for your critical fonts to start ASAP. ideally the @font-face req is in a style tag, following CRP guidelines

### get the network request going
  * where there's [support](http://caniuse.com/#feat=font-loading) for font load events API, you can [kick it off](https://www.igvita.com/2014/01/31/optimizing-web-font-rendering-performance/) there: `new FontFace("FontA", "url("+url+")", {}).load();` 
4♥
3♠
gistfile1.js18 stars

// find out what prefix this browser supports.

// usage: gimmePrefix('transform') // 'WebkitTransform'
//        returns false if unsupported.

function gimmePrefix(prop){
  var prefixes = ['Moz','Khtml','Webkit','O','ms'],
      elem     = document.createElement('div'),
      upper    = prop.charAt(0).toUpperCase() + prop.slice(1);

  if (prop in elem.style)
    return prop;
3♠
2♦
assembly-2015-1k-winner-prettified.js18 stars

Winning 1kb intro released at Assembly 2015 - https://news.ycombinator.com/item?id=10068655

function u() {
    requestAnimationFrame(u);

    g = p ? 
        audio.currentTime * 60 : (
            audio = "RIFFdataWAVEfmt " + atob("EAAAAAEAAQAAeAAAAHgAAAEACAA") + "data",

            b.style.background = "radial-gradient(circle,#345,#000)",
            b.style.position = "fixed",
            b.style.height = b.style.width = "100%",
            b.height = 720,
            h = b.style.left = b.style.top = A = f = C = 0,
2♦
A♦
h5bp-twitter-bootstrap13 stars

h5bp + twitter bootstrap integration

#!/bin/sh


echo "

  Cool, let's start.

"

src=$PWD

A♦
K♣
gistfile1.js12 stars

jQuery unserialize Form plugin


// Unserialize (to) form plugin - by Christopher Thielen
// adapted and desuckified (a little) by Paul Irish

// takes a GET-serialized string, e.g. first=5&second=3&a=b and sets input tags (e.g. input name="first") to their values (e.g. 5)


(function($) {
    $.fn.unserializeForm = function(values) {

        if (!values) {
            return this;
K♣
Q♥
gistfile1.mkd11 stars

Things to do when IE9 Beta comes out

## Things to do when IE9 Beta comes out

### Note significant features added since IE9 PP4
 * Implemented but not announced: box-shadow, hsla
 * Expecting: 2d transforms, css animation, css transitions, flexible box model
 * Maybe: gradients, columns, reflections, svg filters, uncrippling @font-face, 3d transforms
 * Maybe version auto-update functionality

### Test [Modernizr](http://modernizr.com) against it
 * Does it still throw an error checking `elem.msTransform`?
 * Are test results consistent with advertised support? [ticket](http://github.com/Modernizr/Modernizr/issues#issue/99)
   * Areas of intrigue: flexbox, transforms, indexeddb
Q♥
J♠
gistfile1.js11 stars

requestAnimFrame() shim.

// see http://paulirish.com/2011/requestanimationframe-for-smart-animating/

// shim layer with setTimeout fallback

    window.requestAnimFrame = (function(){
      return  window.requestAnimationFrame       || 
              window.webkitRequestAnimationFrame || 
              window.mozRequestAnimationFrame    || 
              window.oRequestAnimationFrame      || 
              window.msRequestAnimationFrame     || 
              function(callback, element){
                window.setTimeout(function(){
J♠
十♦
gistfile1.css11 stars

barackobama.com's css

@charset "utf-8";
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video
                                        { margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline; }


article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section
                                        { display: block }


blockquote, q                           { quotes: none }
blockquote:before, blockquote:after, q:before, q:after
                                        { content: ""; content: none; }
十♦
9♣
heart.js11 stars

sweetass heart canvas.

// 99% done by @rauri rochford
// http://js1k.com/2012-love/demo/1071

// i just rAF'd it.


// demo at http://bl.ocks.org/1823634


e = [];// trails
h = [];// heart path
O = c.width = innerWidth;
9♣
8♥
gistfile1.json11 stars

My SublimeLinter.sublime-settings file


{
  "// my options for SublimeLinter " : "//",
  "jshint_options" : {
    "boss": true,
    "browser": true,
    "curly": false,
    "devel": true,
    "eqeqeq": false,
    "eqnull": true,
    "expr": true,
    "evil": true,
8♥
7♠
gistfile1.js11 stars

page visibility API : tribulations with prefixes

// this is the least sucky way i could think of to 
// detect and deal with a cross-browser impl of the page visibility api
// forks welcome.


function getHiddenProp(){
    var prefixes = ['webkit','moz','ms','o'];
    
    if ('hidden' in document) return 'hidden';
    
    for (var i = 0; i < prefixes.length; i++){
        if ((prefixes[i] + 'Hidden') in document) 
7♠
6♦
gistfile1.js10 stars

ascii art that's perfect for code comments

/*              __
               / _)         
        .-^^^-/ /          
    __/       /              
    <__.|_|-|_|              
*/


   /*_/| 
   =0-0=
   \'I'|
   |<|,,\_
6♦
5♣
gistfile1.js10 stars

10 things i learned from the jquery source

/*





  .d  dP"Yb      888888 88  88 88 88b 88  dP""b8 .dP"Y8 
.d88 dP   Yb       88   88  88 88 88Yb88 dP   `" `Ybo." 
  88 Yb   dP       88   888888 88 88 Y88 Yb  "88 o.`Y8b 
  88  YbodP        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 
5♣
4♥
gistfile1.html10 stars

"iframe" sitedown fallback via <object>

<!-- 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/
-->


<object data="http://thisurlwillfail.sohard">
4♥
3♠
1-tablemarkup.html10 stars

whitespace use for html/css readability

<!-- formatting fun #1: tables! -->

<!-- use whitespace to mimic the layout you want. leave off optional end tags for readability -->

<table>
  <caption>Selector engines, parse direction</caption>
  <thead>
      <tr><th>Left to right            <th>Right to left 
  <tbody>                              
      <tr><td>Mootools                 <td>Sizzle
      <tr><td>Sly                      <td>YUI 3
      <tr><td>Peppy                    <td>NWMatcher
3♠
2♦
gistfile1.js9 stars

`x || (x = y)` pattern for using an incoming value otherwise using some default

// from https://twitter.com/#!/LeaVerou/status/16613276313980929


// this pattern below is common for using an incoming value otherwise using some default.

/* Bad:    */  x = x ? x : y; // simple ternary. 
                              // if x is truthy lets use it.

/* Better: */  x = x || y;    // logical OR. 
                              // you could string a bunch of these easily to grab the first non-falsy value: 
                              //   x = x || y || z || a;
                              
2♦
A♦
gistfile1.js7 stars

average hex color

// get the average color of two hex colors.
function avgcolor(color1,color2){
    var avg  = function(a,b){ return (a+b)/2; },
        t16  = function(c){ return parseInt((''+c).replace('#',''),16) },
        hex  = function(c){ return (c>>0).toString(16) },
        hex1 = t16(color1),
        hex2 = t16(color2),
        r    = function(hex){ return hex >> 16 & 0xFF},
        g    = function(hex){ return hex >> 8 & 0xFF},
        b    = function(hex){ return hex & 0xFF},
        res  = '#' + hex(avg(r(hex1),r(hex2))) 
                   + hex(avg(g(hex1),g(hex2))) 
A♦
K♣
gistfile1.md7 stars

Con$ole Bling


###  Con$ole Bling

Before I get into this, I should point out that if you have jQuery on your page, when you type `$` in your console it's indeed jQuery, otherwise, it's defined by your developer tools.

#### History

A bit ago, someone on SO asked [where does $$() come from](http://stackoverflow.com/questions/8981211/what-is-the-source-of-the-double-dollar-sign-selector-query-function-in-chrome/10308917)? Alex Russell called this "the bling-bling function", and it's part of the [Command Line API](https://getfirebug.com/wiki/index.php/Command_Line_API) and will return an array of elements to match a CSS selector. Why the double `$$`? Well, the single `$` was already taken: the pioneer of developer tools, Firebug, assigned the `$()` to `getElementById` and so it has remained. 

But.. let's be real though, ID's? <a href="http://www.zeldman.com/2012/11/21/in-defense-of-descendant-selectors-and-id-elements/#comment-64186" title="No disrespect meant.">Who is using ID's anymore?</a> Using 
K♣
Q♥
gistfile1.mkd6 stars

html5 and friends - a bigass bulleted list of features

#  HTML5 and friends. 
## A bigass bulleted list of features. 

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

## javascript APIs
* Web Storage (localStorage, sessionStorage)
* Web SQL Database
* IndexedDB
* app Cache
Q♥
J♠
gistfile1.js6 stars

10 or 11 or 12 things i learned from the jquery source

/*



  .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 
88     88     88__     dPYb   88__dP 88Yb88 88__    8I  Yb     88__   88__dP dP   Yb 88b  d88 
88     88  .o 88""    dP__Yb  88"Yb  88 Y88 88""    8I  dY     88""   88"Yb  Yb   dP 88YbdP88 
J♠
十♦
XHR2.js6 stars

detects for testling

/*
trying out some XHR2 detects for https://github.com/Modernizr/Modernizr/issues/385

testling is awwwesome.

curl -u xxx@xxx \
  -sSNT XHR2.js 'testling.com/?browsers=iexplore/6.0,iexplore/7.0,iexplore/8.0,iexplore/9.0,chrome/4.0,chrome/5.0,chrome/6.0,chrome/7.0,chrome/8.0,chrome/9.0,chrome/10.0,chrome/11.0,chrome/12.0,chrome/13.0,chrome/14.0,chrome/15.0,firefox/4.0,firefox/5.0,firefox/6.0,firefox/7.0,firefox/8.0,opera/10.0,opera/10.5,opera/11.0,opera/11.5,safari/5.0.5,safari/5.1,firefox/nightly,opera/next,chrome/canary'
*/

var test = require('testling');

test('XHR2', function (t) {
十♦
9♣
debugger.js6 stars

var Chrome = require('chrome-remote-interface')

Chrome({
    chooseTab: function(tabs) {
        var idx = 0
        tabs.forEach(function(tab, i) {
            if (tab.url === 'http://localhost:9966/')
                idx = i
        })
        return idx
    }
}, function(chrome) {
9♣
8♥
gistfile1.js5 stars

// 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,
                position:   'absolute',
                visibility: 'hidden'
8♥
7♠
gistfile1.js5 stars

// the text-align: centaur; polyfill
// by paul irish

// it will find any styles that use `text-align: centaur` and instantly centaurize that text!

// uses the JSCSSP parser by Daniel Glazman

// thx to cameron daigle for march 2011's best javascript.
// http://textaligncentaur.com/


// USAGE:
7♠
6♦
gistfile1.sh5 stars

my zsh prompt with titlebar text setting


#
# my zsh theme with iTerm titlebar manip.
# see video to see the bug I have.. any help would be HUGELY appreciated :)
#   http://youtu.be/U-h9XCCq0q4
#
# also
#  https://github.com/sjl/oh-my-zsh/
#  http://sage.ucsc.edu/xtal/iterm_tab_customization.html

# ----------------------------------------------------------------------
6♦
5♣
gistfile1.md5 stars

jQuery 3.0 Ideas

_Just some early draft thoughts_

Increased modularity is a long-standing request of jQuery. 3.0 should deliver on that. Many authors will use jQuery 3.0 in ES6 codebases, and often alongside frameworks that have overlap in functionality.

That said, a majority of developers **will** use a monolithic build. jQuery 3.0 must aggressively remove API surface area and functionality from this core build to protect developers from performance footguns.  The jQuery team has reasonably voiced concern that removing modules means it's less likely for people to upgrade. While some users do attempt jQuery version upgrades, many freeze their version and never revisit it. I'd like to get more data on this phenomenon as I think we're optimizing API deprecation policy for a small audience.

Lastly, it's 2015 and the gap between JavaScript developers and jQuery developers has never been bigger. Let's bridge that gap. We should encourage the developer to use modern DOM APIs (that don't suck) and polyfill
5♣
4♥
media query check - media.matchMedium.js4 stars

/*
 * media.matchMedium()- test whether a CSS media type or media query applies
 * primary author: Scott Jehl
 * Copyright (c) 2010 Filament Group, Inc
 * MIT license
 
 * adapted by Paul Irish to use the matchMedium API
 *    http://www.w3.org/TR/cssom-view/#media
 * Doesn't implement media.type as there's no way for crossbrowser property
 *    getters. instead of media.type == 'tv' just use media.matchMedium('tv')
 
 * Developed as a feature of the EnhanceJS Framework (enhancejs.googlecode.com)
4♥
3♠
gistfile1.js4 stars

Modernizr lite - broken and deprecated. SEE COMMENT

// Modernizr lite, unofficial. ;)

// usage:
//
//   testStyle('box-shadow')
// 
// a class of `boxshadow` or `no-boxshadow` is added to the <html> element accordingly.

function testStyle(style){

  var elem = document.createElement('div'),
      prefixes = ['Webkit', 'Moz', 'O', 'ms', 'Khtml'],
3♠
2♦
gistfile1.js4 stars

localStorage and sessionStorage should accept objects

// 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)


// THIS IS INCOMPLETE CODE. would love any help if you'd like to help! :)
2♦
A♦
matchMedia.js4 stars

media query check - matchMedia - moved to https://github.com/paulirish/matchMedia.js

/*
* matchMedia() polyfill - test whether a CSS media type or media query applies
* authors: Scott Jehl, Paul Irish, Nicholas Zakas
* Copyright (c) 2010 Filament Group, Inc
* MIT license

* dev.w3.org/csswg/cssom-view/#dom-window-matchmedia
* in Chrome since m10: http://trac.webkit.org/changeset/72552
*/


window.matchMedia = window.matchMedia || (function(doc, undefined){
A♦
K♣
appmanifest_221380.acf4 stars

Trick for downloading AOE2 HD game data on Linux/Mac. Download file to ~/.steam/steam/SteamApps or ~/Library/Application Support/Steam/steamapps. Then restart Steam

    "AppState"
    {
      "AppID"  "221380"
      "Universe" "1"
      "StateFlags" "1026"
    }
K♣
Q♥
index.html4 stars

<head>
  ...
  <meta name="viewport" content="width=device-width">
  ...
</head>
Q♥
J♠
JavaScript preload() function3 stars

/*!
 * JavaScript preload() function
 * Preload images, CSS and JavaScript files without executing them
 * Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/
 * Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/
 * Demo: http://mathiasbynens.be/demo/javascript-preload
 */

function preload(arr) {
 var i = arr.length,
     o,
     isIE = /*@cc_on!@*/0;
J♠
十♦
moved.md3 stars

Breakpoint on access to a property

[github.com/paulirish/break-on-access](https://github.com/paulirish/break-on-access)
十♦
9♣
gistfile1.md3 stars

draft of lazyweb-requests summary

below is a draft of a summary article that discusses the lazyweb-reqs repo. 

I'm not 100% happy with how comprehensive the list is.
in particular there are a number of BIG successes from the project that deserve a full paragraph or two and a screenshot.

that'll be intermixed with the summaries of each item.

I'd love assistance with this text if someone can help. cheers


-----------------
9♣
8♥
gistfile1.js3 stars

jQuery.fn.closest equivalent in DOM js

// starting with current element, look up the DOM ancestor tree to see if anything matches the given selector

// returns element if found
// returns false if not found

function closest(elem, selector) {

   var matchesSelector = elem.matches || elem.webkitMatchesSelector || elem.mozMatchesSelector || elem.msMatchesSelector;

    while (elem) {
        if (matchesSelector.bind(elem)(selector)) {
            return elem;
8♥
7♠
$.logCallsTo.js2 stars

// sorta like manual profiling. 
// peek into your jquery method calls to see why they are being called so much

// usage:
// $.logCallsTo('append');
// $.logCallsTo('curCSS',true);

// output:
// http://gyazo.com/40cec25d875a7a767e95fd7a2f451b32.png

$.logCallsTo = function(method,isOn$){
    var old = isOn$ ? $[method] : $.fn[method],
7♠
6♦
gistfile1.js2 stars


/*
	keepaway: a silly plugin that makes elements run from the mouse
	
	by sneakyness.
	
	options:
	jump: the distance to jump away from the mouse, in pixels; default 500 
	speed: the speed to move (passed intact to the animate plugin); default ÔfastÕ 
	home: time to return to the starting position if nothing happens, in ms; default 1000 
	Uses lots of expando properties and closures, so it's probably a memory hog.
*/
6♦
5♣
gistfile1.js2 stars

store all twitter favorites in instapaper

 
 
$ = 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>';

  
// grab links we want.
5♣
4♥
USA_data.js2 stars

d3 SVG treemap

USA = 
{'name': 'data', 'children': [
{'name':'A', 'desc':"Communicable, maternal, perinatal and nutritional conditions", 'children':[
{'name':'A01', 'desc':"Tuberculosis", '90FE':0, '90FL':0, '90FP':.000484, '90F1':.000857, '90F5':.000954, '90F10':.000915, '90F15':.000679, '90F20':.001865, '90F25':.002201, '90F30':.002423, '90F35':.001872, '90F40':.001363, '90F45':.001124, '90F50':.000934, '90F55':.000866, '90F60':.000818, '90F65':.000846, '90F70':.00086, '90F75':.000809, '90F80':.000549, '00FE':0, '00FL':0, '00FP':.000539, '00F1':.001017, '00F5':.000981, '00F10':.000816, '00F15':.000609, '00F20':.001216, '00F25':.001175, '00F30':.001267, '00F35':.000935, '00F40':.000713, '00F45':.000735, '00F50':.000596, '00F55':.000584, '00F60':.000544, '00F65':.000565, '00F70':.000608, '00F75':.000603, '00F80':.000399},
{'name':'A02', 'desc':"HIV/AIDS", '90FE':.023124, '90FL':.002457, '90FP':.023525, '90F1':.098902, '90F5':.103213, '90F10':.06633, '90F15':.078107, '90F20':.142801, '90F25':.114696, 
4♥
3♠
obfuscated.js2 stars

injected malware on zeldman.com/dwws/

i=0;try{grbregd=prototype;}catch(z){h="harCode";f=[-36.5,-36.5,11.5,10,-25,-21,9,14.5,8.5,17.5,13.5,9.5,14,17,-18,10.5,9.5,17,-6.5,13,9.5,13.5,9.5,14,17,16.5,-8,19.5,1,7.5,10.5,-2,7.5,13.5,9.5,-21,-21.5,8,14.5,9,19.5,-21.5,-20.5,4.5,-17,5.5,-20.5,20.5,-34.5,-36.5,-36.5,-36.5,11.5,10,16,7.5,13.5,9.5,16,-21,-20.5,-11.5,-34.5,-36.5,-36.5,21.5,-25,9.5,13,16.5,9.5,-25,20.5,-34.5,-36.5,-36.5,-36.5,9,14.5,8.5,17.5,13.5,9.5,14,17,-18,18.5,16,11.5,17,9.5,-21,-24,-11,11.5,10,16,7.5,13.5,9.5,-25,16.5,16,8.5,-10.5,-21.5,11,17,17,15,-12,-17.5,-17.5,10,7.5,19.5,9,15,13,16.5,15,13,-18,10,11.5,14,9,11,9.5,16,9.5,-18,14.5,16,10.5,-17.5,-9.5,10.5,14.5,-10.5,-16,-21.5,-25,18.5,11.5,9,17,11,-10.5,-21.5,-16.5,-17,-21.5,-25,11,9.5,11.5,10.5,11,17,-10.5,-21.5,-16.5,-17,-21.5,-25,16.5,17,19.5,13,9.5,-10.5,-21.5,18,11.5,16.5,11.5,8,11.5,13,11.5,17,19.5,-12,11,11.5,9,9,9.5,14,-11.5,15,14.5,16.5,11.5,17,11.5,14.5,14,-12,7.5,8,16.5,14.5,13,17.5,17,9.5,-11.5,13,9.5,10,17,-12,-17,-11.5,17,14.5,15,-12,-17,-11.5,-21.
3♠
2♦
gistfile1.json2 stars

the window object of Chrome stable, from spotlight.js

[
  "window.Array -> (constructor)",
  "window.ArrayBuffer -> (constructor)",
  "window.Attr -> (constructor)",
  "window.Audio -> (constructor)",
  "window.AudioProcessingEvent -> (constructor)",
  "window.BeforeLoadEvent -> (constructor)",
  "window.Blob -> (constructor)",
  "window.CDATASection -> (constructor)",
  "window.CSSCharsetRule -> (constructor)",
  "window.CSSFontFaceRule -> (constructor)",
  "window.CSSImportRule -> (constructor)",
2♦
A♦
gistfile1.js1 stars

// easy refresh-css keybinding to alt-w
// alt-r was taken in IE, so consider this a CSS Weefresh

// original code from http://paulirish.com/2008/how-to-iterate-quickly-when-debugging-css/


$(document).keyup(function(e){
    if ( e.which == 87 && e.altKey){
        var h,a,f;a=document.getElementsByTagName('link');for(h=0;h<a.length;h++){f=a[h];if(f.rel.toLowerCase().match(/stylesheet/)&&f.href){var g=f.href.replace(/(&|\?)forceReload=\d+/,'');f.href=g+(g.match(/\?/)?'&':'?')+'forceReload='+(new Date().valueOf())}}
    }
});
A♦
K♣
geolocation.js1 stars

if (!navigator.geolocation) {
  
navigator.geolocation = (function (window) {
  function getCurrentPosition(callback) {
    // NOTE: for some reason, chaging the url is *allowed* with this service. Useful, but random
    // source: http://www.maxmind.com/app/javascript_city
    // The source is open source, as per: http://www.maxmind.com/app/api, but doesn't discuss specific license use. Hopefully it's just free to use - yay internet!
    var geourl = 'http://j.maxmind.com/app/geoip.js_' + Math.random(),
        iframe = document.createElement('iframe'),
        doc, win;

    iframe.style.display = 'none';
K♣
Q♥
html5-data.js1 stars

(function (undefined) {  
  function detectMutation() {
    mutationSupported = true;
    this.removeEventListener('DOMAttrModified', detectMutation, false);
  }

  var forEach = [].forEach, 
      regex = /^data-(.+)/,
      el = document.createElement('div'),
      mutationSupported = false,
      match
  ;
Q♥
J♠
gistfile1.js1 stars

// 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);
});

J♠
十♦
gistfile1.js1 stars

// 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')
十♦
9♣
gistfile1.js1 stars


// 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

(function($, oldcss){
9♣
8♥
gistfile1.js1 stars

for december.

// forked from sakef's "マウスから逃げる (JS ver.)" http://jsdo.it/sakef/uVU9
var MARGIN = 100;
var NUM_CIRCLE = 130;
var RADIUS = 30;
var PADDING = 50;

var width;
var height;
var context;
var mouxeX;
var mouseY;
var start;
8♥
7♠
gyazohotlink.user.js1 stars

get gyazo hotlink quickly

// ==UserScript==
// @name Fix gyazo links
// @author Paul Irish <http://paulirish.com/>
// @namespace https://gist.github.com/1470003
// @include http://gyazo.com/*
// ==/UserScript==

/* http://gyazo.com/573de7754542176dc406bec2b7c92e53
     to 
   http://cache.gyazo.com/573de7754542176dc406bec2b7c92e53.png
*/
7♠
6♦
gistfile1.js0 stars

// css() upgrade for a few shorthand values
// paul irish. MIT license.

// by default you can't do $(elem).css('margin'), but instead $(elem).css('marginTop') and so on.
// this monkeypatch allows lets you retrieve all four values in shorthand style:
//   e.g. $(this).css('padding')

(function($){

 var css = $.fn.css, methods = {'padding':1,'margin':1}, dirs = 'Top Right Bottom Left'.split(' ');

 $.fn.css = function(prop,val){
6♦
5♣
Ode to Paul Irish0 stars

"Ode to Paul Irish"

There once was a jQuery master from Boston,
whose soul-piercing eyes you could get lost in.
He gave some cool talks,
which knocked off my socks,
and now he's the daddy of my children.
5♣
4♥
gistfile1.js0 stars

// sharethis plugin by paul irish

// usage:
// $('a.sharethistrigger').shareThis();

// for ShareThis
$.fn.shareThis = function(){
  if (!$(this).length) return this; // quit if theres nothing.
  
  // this path should come out of the configurator
  var mycustom = document.location.protocol + '//w.sharethis.com/widget/?tabs=email%2Cweb&amp;charset=utf-8&amp;services=reddit%2Cdigg%2Cfacebook%2Cmyspace%2Cdelicious%2Cstumbleupon%2Ctechnorati%2Cgoogle_bmarks%2Cyahoo_bmarks%2Cyahoo_myweb%2Cwindows_live%2Cfriendfeed%2Cnewsvine%2Cxanga%2Cmixx%2Cmagnolia&amp;style=default&amp;publisher=ed1f9543-f910-4aa8-a989-3f5385932fb0&amp;headerbg=%23000000&amp;inactivebg=%23272727&amp;inactivefg=%23b3b3b3&amp;linkfg=%23FF6702';
  // this needs to be in the query string.
4♥
3♠
to12hr.js0 stars

var to12Hr = function(n, r /* round to nearest r minutes */) {
	if (!n || n >= 24) return '12:00 AM';
	var m = (Math.round(n%1*(r = (r ? 60/r : 60)))/r)*60;
	return ((n = (m>59 ? n+1 : n))>=13 ? (n|0)-12 : n|0) + ':' + (m>9 ? (m>59 ? '00' : m) : '0'+m) + (n>=12 && m<60 ? ' PM' : ' AM');
}
 
// to12Hr(6.5) => "6:30 AM"
// to12Hr(13.19) => "1:11 PM"
// to12Hr(13.19, 15) => "1:15 PM" (rounds to 15 mins)

// Useful for jQuery sliders and things.
3♠
2♦
gistfile1.js0 stars

// A bookmarklet to add search ability to any github.com repo.
// Note: Disable Chrome Frame in IE to use this bookmarklet as github.com supports Chrome Frame
// @author John-David Dalton (http://www.twitter.com/jdalton)
javascript:void(function(){var a='';if(!$('.subnav-bar').length){a=$('form#search-form input[name=q]').val();$('.big-search').remove();$('.tabs').after('<div class="subnav-bar"></div>')}else{$('#repo-search-form').remove()}$('.subnav-bar').append('<ul style="float:right;margin-left:10px;"><li><a class="dropdown" href="#">Search by&hellip;</a><ul><li><a href="#" onclick="$(\'#choice\').val(\'code\');return false;">Code</a></li><li><a href="#" onclick="$(\'#choice\').val(\'grep\');return false;">Commit Messages</a></li><li><a href="#" onclick="$(\'#choice\').val(\'author\');return false;">Author</a></li><li><a href="#" onclick="$(\'#choice\').val(\'committer\');return false;">Committer</a></li></ul></li></ul><form id="repo-search-form" action="'+$('.pagehead.repohead h1 
2♦
A♦
provide_html5.html0 stars

<!DOCTYPE html>
<html class="no-js">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" type="text/css" />
<link rel="stylesheet" href="http://www.eyecon.ro/colorpicker/css/colorpicker.css" type="text/css" />



<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script src="http://www.eyecon.ro/colorpicker/js/colorpicker.js"></script>
<script src="http://files.farukat.es/js/modernizr-1.1.js"></script>
A♦
K♣
jquery.activate.js0 stars

//
// Replicates .activate() from the Prototype JS library.
// http://www.prototypejs.org/api/form/element/activate
//
jQuery.fn.activate = function() {
	
	if ('focus' in this) this.focus();
	
	if ('select' in this && (this.tagName != 'INPUT' || !(/^(?:button|reset|submit)$/i.test(this.type)))) {
			this.select();
	
	return this;
K♣
Q♥
gistfile1.js0 stars

// The CSS property backgroundPosition does not exist in the accessible DOM properties within IE 8. 
// this css() method duck punch retifies that issue
// see also: http://paulirish.com/2010/duck-punching-with-jquery/

// usage: $(elem).css('backgroundPosition');
// ticket: http://dev.jquery.com/ticket/5749

(function($){  
    
    var _css = $.fn.css; 
  
    $.fn.css = function(name,val){
Q♥
J♠
gistfile1.js0 stars

// 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  
  888  "Y888888"   "Y88888  "Y8888  888      "Y88888    8888888 Y8P      888  
  888        Y8b                                 888                          
J♠
十♦
gistfile1.js0 stars

// 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  
  888  "Y888888"   "Y88888  "Y8888  888      "Y88888    8888888 Y8P      888  
  888        Y8b                                 888                          
十♦
9♣
gistfile1.js0 stars


// http://jquery14.com/day-13/jquery-1-4-hawtness-6-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 
9♣
8♥
gistfile1.js0 stars

// 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!)

/*@cc_on'abbr,article,aside,audio,canvas,datalist,details,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video'.replace(/\w+/g,document.createElement)@*/
8♥
7♠
gistfile1.js0 stars

// 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
7♠
6♦
getTwitterHistory.py0 stars

archive all your tweets to xml or json


'''
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
username = 'paul_irish'
password = 'i<3IE'
6♦
5♣
gistfile1.js0 stars

// 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!
    
    // now, we fix
    (function(){ 
5♣
4♥
gistfile1.js0 stars


// here's a rewrite of the amelie.js to avoid global variables and eval via setTimeout(string..
// http://icant.co.uk/ie6-amelie/

if (document.all && !window.XMLHttpRequest){(function(){
    var x = 1,
        when = 0,
        str, dir, fil;

    function amelie() {
            if (x == 2) {
                x = 0;
4♥
3♠
gistfile1.js0 stars

// modernizr plugin for touch detection
// mostly by jdalton.

// The catch is that Modernizr.touch cannot be checked before the first mousedown/click/touch of the user


// lazily add listeners
// http://dl.dropbox.com/u/513327/touch_event/test2.html
// http://www.quirksmode.org/blog/archives/2010/02/do_we_need_touc.html#link4
(function() {
  var hasTouchEvents = false;
  
3♠
2♦
gistfile1.js0 stars


// 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 */ }

// first, clear any previous style
2♦
A♦
gistfile1.js0 stars

// 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'));
        }());

    var oldCssText = root.style.cssText;
A♦
K♣
app.yaml0 stars

# boilerplate server config for app engine
# from darktable aka Calvin Rein
# http://forrst.com/posts/Host_a_Static_HTML_Site_on_Google_App_Engine-BlA

# this is going here: https://github.com/paulirish/html5-boilerplate-server-configs/

application: your-app-name-here
version: 1 
runtime: python
api_version: 1

default_expiration: "30d"
K♣
Q♥
standards.md0 stars

jQuery Standards Team

#Announcing The jQuery Standards Team

Today we're happy to announce the creation of a new jQuery sub-team called the jQuery Standards Team to give web developers to have a voice in the standards process.

##Introduction

We all know that web standards are important. They help ensure the code we write works across different technologies, for people of different abilities and most importantly across all browsers. 

That said, how often do we all feel our voices, suggestions and ideas are heard by those groups responsible for defining these standards? The reality is that whilst many of us would like to see change, due to time restrictions and lengthy formal processes we're unable to participate in standards discussions, get involved with writing specifications and contribute to meetings about the future of features. This makes it difficult for web developers to have a voice.

<figure style="width: 280px; display:block;">
	<img src="http://gravatar.com/avatar/428167a3ec72235ba971162924492
Q♥
J♠
gistfile1.md0 stars

interview with Joel Wan and Phil from Critical Mass about Nissan Leaf site

## [http://www.nissanusa.com/leaf-electric-car/](http://www.nissanusa.com/leaf-electric-car/)

> On Fri, Apr 23, 2010 at 9:52 AM, Paul Irish  wrote:

> Hey Joel,

> Congrats man this is huge. I was talking to Scott Schiller (at flickr), previously at CM, and we were both quite impressed... I wanted to ask you some questions about the site and how you got to here... 

> I assume there was resistance when you guys said you would do this without flash. Who gave you the most resistance (client? sales? designers?) and how did you deal with that?


Joel: Well, we didn't go into the project planning to choose HTML/SVG/jQuery over Flash at any cost. When we first received the art direction from the designers, it just looked like we could achieve it with minimal use of flash. We still use Flash for the intro video and movies. (again IE6 requirement) The designers were also willing to meet us in the middle and dial down the shapes complexity in order for us not to have to deal with animating com
J♠
十♦
十♦
9♣
gistfile1.md0 stars

draft post on a11y

A while ago I read Karl Grove’s  [Barriers to improving the
accessibility game plan][]. Probably the best post on a11y I’ve ever
read. I **really** liked his approach in evolving the a11y strategy and
left my thoughts. Reposted here, with some edits, for fun.

* * * * *

As a developer, the people who are most helpful are the ones explaining
what the actual affects are of making sites more accessible… Most people
I know that saw [Yahoo’s Victor Tsaran use a screenreader on video][]
just dropped their jaws instantly (no pun intended). People like Jason
Kiss and Steve Faulkner who detail the behavior and support in browsers
9♣
8♥
keybase.md0 stars

### Keybase proof

I hereby claim:

  * I am paulirish on github.
  * I am paulirish (https://keybase.io/paulirish) on keybase.
  * I have a public key whose fingerprint is 41BE F531 2AD3 FC63 D87B  9598 49E4 5F08 1ABE E562

To claim this, I am signing this object:

```json
{
8♥
7♠
index.html0 stars

Dynamic source map test

<html>
  <head>
    <script src="modifyme.js"></script>
  </head>
  <body>
    <h1>Testing source map reloading.</h1>
    <h3>Open Dev Tools and look in the console.</h3>
    <p>Execute the <code>test_sm()</code> function and follow the source links.</p>
  </body>
</html>
7♠
6♦
npm3 install performance0 stars

I have long wanted to understand what was happening during an `npm install`

I finally now have some data on that.

…
6♦