Skip to content

Instantly share code, notes, and snippets.

View jeresig's full-sized avatar

John Resig jeresig

View GitHub Profile
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
$ traceroute code.jquery.com.s3.amazonaws.com
traceroute to s3-directional-w.amazonaws.com (72.21.207.134), 64 hops max, 40 byte packets
1 192.168.0.1 (192.168.0.1) 0.539 ms 0.161 ms 0.155 ms
2 * * *
3 ge-2-5-ur02.cambridge.ma.boston.comcast.net (68.85.160.229) 7.691 ms 9.447 ms 7.466 ms
4 te-8-1-ur01.cambridge.ma.boston.comcast.net (68.87.144.69) 8.023 ms 9.065 ms 8.108 ms
5 te-9-2-ar01.foxboro.ma.boston.comcast.net (68.85.162.65) 9.744 ms 10.947 ms 9.697 ms
6 po-11-ar01.berlin.ct.hartford.comcast.net (68.87.146.33) 12.761 ms 21.855 ms 13.481 ms
7 po-10-ar01.chartford.ct.hartford.comcast.net (68.87.146.29) 15.397 ms 13.348 ms 14.229 ms
8 te-0-4-0-1-cr01.newyork.ny.ibone.comcast.net (68.86.90.61) 16.442 ms 22.821 ms 15.768 ms
@jeresig
jeresig / isObjectLiteral.html
Created July 23, 2009 17:26
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.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<!-- Online here: http://ejohn.org/files/bugs/isObjectLiteral/ -->
<title>isObjectLiteral</title>
<style>
li { background: green; } li.FAIL { background: red; }
iframe { display: none; }
</style>
// Slightly rewritten code from here:
// http://blog.mozilla.com/webdev/2009/08/06/html5-audio-soundboard/
$("audio").removeAttr("controls").each(function(i, audio) {
$('<button>')
.text( $(this).attr("title") )
.click(function() {
audio.play();
))
.appendTo("#doc");
});
# Rename an email address in all old commits.
# WARNING: Will change all your commit SHA1s.
# Based off of the script from here:
# http://coffee.geek.nz/how-change-author-git.html
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "joern.zaefferer@googlemail.com" ];
then
GIT_AUTHOR_EMAIL="joern.zaefferer@gmail.com";
GIT_COMMITTER_EMAIL="joern.zaefferer@gmail.com";
git commit-tree "$@";
$ git clone git@github.com:jquery/jquery.git
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...
The difference between .closest(selector) and .closest([selectorA, selectorB, ...])
and how it works with .live() in 1.4.
Sample DOM:
<html>
<body>
<div id="main">
<div id="test">
<div id="mouseme"></div>
<?php header('HTTP/1.0 500 Internal Server Error'); exit; ?>
@jeresig
jeresig / sizzle-commit.sh
Created January 24, 2011 22:06
A shell script for committing to both Sizzle and jQuery simultaneously.
#!/bin/sh
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
jeresig / release.sh
Created January 24, 2011 22:09
Push a new jQuery release up to the CDN.
#!/bin/tcsh
# Create a new jQuery Relase
# Run like so:
# ./release.sh VERSION
# By John Resig
git pull
echo -n $1 > version.txt
git add version.txt