Created
April 22, 2011 16:38
-
-
Save cowboy/937006 to your computer and use it in GitHub Desktop.
JavaScript: Duck Punching vs Dick Punching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Duck Punching. | |
window._alert = window.alert; | |
window.alert = function(n) { | |
return typeof n === 'number' | |
? window._alert('QU' + Array(n + 1).join('A') + 'CK') | |
: window._alert.apply(window, arguments); | |
}; | |
// Dick Punching. | |
window._alert = window.alert; | |
window.alert = function(n) { | |
return typeof n === 'number' | |
? window._alert('8' + Array(n + 1).join('=') + 'D') | |
: window._alert.apply(window, arguments); | |
}; |
// Duck pinching
location.href="http://furf.it/6O";
// Dick pinching
return; // will not go there
Hahaha awesome.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: don't try to duck punch and dick punch the same function or you'll end up with a very, very angry duck.