Skip to content

Instantly share code, notes, and snippets.


John Resig jeresig

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jeresig on github.
  • I am jeresig ( on keybase.
  • I have a public key whose fingerprint is 1720 9477 977B 343F EC42 B6D4 1E87 2B3A D262 C861

To claim this, I am signing this object:

View nyt-upshot.css
@media screen and (max-width: 719px) {
.nytint-upshot-stream-item-bCol {
margin: 0;
.nytint-upshot-stream-item .photo.embedded.layout-large-horizontal,
.nytint-upshot-stream-item-article .story-heading {
max-width: 100%;
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
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
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 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 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 error.php
<?php header('HTTP/1.0 500 Internal Server Error'); exit; ?>
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
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
You can’t perform that action at this time.