Skip to content

Instantly share code, notes, and snippets.

@sczizzo
Created August 8, 2011 20:20
Show Gist options
  • Save sczizzo/1132629 to your computer and use it in GitHub Desktop.
Save sczizzo/1132629 to your computer and use it in GitHub Desktop.
Fuck up any page nice enough to use jQuery
// 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