Skip to content

Instantly share code, notes, and snippets.

John Resig jeresig

Block or report user

Report or block jeresig

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jeresig /
Created Jan 24, 2011
Push a new jQuery release up to the CDN.
# Create a new jQuery Relase
# Run like so:
# By John Resig
git pull
echo -n $1 > version.txt
git add version.txt
jeresig /
Created Jan 24, 2011
A shell script for committing to both Sizzle and jQuery simultaneously.
git add test/unit/selector.js sizzle.js
git commit -m "$1"
git push
cp test/unit/selector.js ../jquery/test/unit/
cp test/data/sizzle-jquery.js ../jquery/src/
cd ../jquery
View error.php
<?php header('HTTP/1.0 500 Internal Server Error'); exit; ?>
View closest14
The difference between .closest(selector) and .closest([selectorA, selectorB, ...])
and how it works with .live() in 1.4.
Sample DOM:
<div id="main">
<div id="test">
<div id="mouseme"></div>
View Cloning jQuery
$ git clone
Initialized empty Git repository in /Users/jeresig/jquery/.git/
remote: Counting objects: 10447, done.
remote: Compressing objects: 100% (3113/3113), done.
remote: Total 10447 (delta 6877), reused 10399 (delta 6832)
Receiving objects: 100% (10447/10447), 4.95 MiB | 2.32 MiB/s, done.
Resolving deltas: 100% (6877/6877), done.
$ cd jquery
$ make jquery
Grabbing external dependencies...
View gist:199298
# Rename an email address in all old commits.
# WARNING: Will change all your commit SHA1s.
# Based off of the script from here:
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "" ];
git commit-tree "$@";
View gist:164163
// Slightly rewritten code from here:
$("audio").removeAttr("controls").each(function(i, audio) {
.text( $(this).attr("title") )
.click(function() {;
jeresig / isObjectLiteral.html
Created Jul 23, 2009
Determining if an object comes from an object literal appears to be tricky - especially if you don't serialize functions and work across windows. Edit isObjectLiteral to come up with a potential solution - and make sure that it works in all browsers.
View isObjectLiteral.html
<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<!-- Online here: -->
li { background: green; } li.FAIL { background: red; }
iframe { display: none; }
View gist:26517
$ traceroute
traceroute to (, 64 hops max, 40 byte packets
1 ( 0.539 ms 0.161 ms 0.155 ms
2 * * *
3 ( 7.691 ms 9.447 ms 7.466 ms
4 ( 8.023 ms 9.065 ms 8.108 ms
5 ( 9.744 ms 10.947 ms 9.697 ms
6 ( 12.761 ms 21.855 ms 13.481 ms
7 ( 15.397 ms 13.348 ms 14.229 ms
8 ( 16.442 ms 22.821 ms 15.768 ms
View How to get Free Credit Scores
How to get Free Credit Scores:
Just after midnight on August 5th I got an email from, what appeared to be,
Bank of America telling me that there was a problem with my account - that
some transactions had been flagged and that I needed to investigate them.
I get these notifications from time-to-time but they're usually accompanied
by a phone call - that did not occur in this case. Of course, I also get
similar emails form phishers, I was quite skeptical. But not wanting to
be affected by the real case I logged into Bank of America (never click
You can’t perform that action at this time.