Created
August 8, 2011 20:20
-
-
Save sczizzo/1132629 to your computer and use it in GitHub Desktop.
Fuck up any page nice enough to use jQuery
This file contains hidden or 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
// TODO More up()s than just deleting elements, e.g. | |
// - Swapping random elements | |
// - Removing random bits of HTML | |
function up(i) { | |
var k = Math.floor(Math.random() * i) % i; | |
var l = Math.floor(Math.random() * i * k) % i; | |
console.log( 'Deleting element: ' + l ); | |
console.log( $('body *:eq(' + l + ')').remove() ); | |
} | |
// TODO Use function mapping from number of page elements to timeout in ms | |
function fuck(i) { | |
if ( i > 0 ) { | |
up(i); | |
setTimeout("fuck(" + i-- + ")", 300); | |
} | |
} | |
fuck($('body *').size()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment