Skip to content

Instantly share code, notes, and snippets.

View gibson042's full-sized avatar

Richard Gibson gibson042

View GitHub Profile
@gibson042
gibson042 / jquery-attr-expando.js
Last active August 29, 2015 14:06
jQuery PR 1652
/*!
* jQuery JavaScript Library v1.11.2-pre
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
@gibson042
gibson042 / simpleCSS.js
Last active August 29, 2015 14:01
jQuery #15098 remote src
// http://bugs.jquery.com/ticket/15098
(function( window ) {
var getStyles, curCSS;
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
};
curCSS = function( elem, name, computed ) {
var ret;
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>QUnit demo</title>
<link rel="stylesheet" type="text/css" href="https://rawgithub.com/gibson042/8592767/raw/9bc1a1a6ec877460420003d3dddf07bdc0304b87/qunit.c621f60e.css">
<script type='text/javascript' src="https://rawgithub.com/gibson042/8592767/raw/6e02a86b147fe8ec4c31db901b31b3ad44c06c34/qunit.c621f60e.js"></script>
<script type='text/javascript'>
QUnit.config.urlConfig.push({
id: "var",
@gibson042
gibson042 / comparison.md
Created October 29, 2012 20:37
Sizzle child cache benchmark comparison
  <th class="text-right">
    sizzle.master
selectors
@gibson042
gibson042 / cautiousData.js
Created June 3, 2012 04:50
Cautious conversion of data- attributes to numbers by jQuery.fn.data
// limit .data number parsing to canonical representations
// fixes jQuery tickets #7579; #11297; #10174
(function( $ ) {
var fnData = $.fn.data;
$.fn.data = function( key, value ) {
if ( value === undefined ) {
// parse data attributes on every element (including forms with unfortunately-named controls)
// before the official jQuery.fn.data gets a chance to