Skip to content

Instantly share code, notes, and snippets.

@amatiasq
Created August 7, 2012 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amatiasq/3285490 to your computer and use it in GitHub Desktop.
Save amatiasq/3285490 to your computer and use it in GitHub Desktop.
Hack today's Google's Doodle (press numpad 0 to start)
function press(key) {
document.getElementById("hplogo").onkeydown({
keyCode:key,
preventDefault:function() { }
});
}
var interval;
document.addEventListener('keydown', function(e) {
if (e.keyCode !== 96)
return;
if (interval) {
clearInterval(interval);
interval = null;
} else {
interval = setInterval(function() {
press(37);
press(39);
}, 0);
}
}, true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment