Skip to content

Instantly share code, notes, and snippets.

@raphaeleidus
Created July 30, 2012 20:44
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 raphaeleidus/3210017 to your computer and use it in GitHub Desktop.
Save raphaeleidus/3210017 to your computer and use it in GitHub Desktop.
ERMAHGERD ERLL THER THERNGS
javascript:(function(){
$('*').contents().each(function(index){
if (this.nodeType !== 3) {
return;
}
var text = $(this).text();
text = text.toUpperCase();
text = text.replace(/[AEIOUY]r(?! )/g, 'E');
text = text.replace(/AA/g, 'A');
text = text.replace(/EE/g, 'E');
text = text.replace(/II/g, 'I');
text = text.replace(/OO/g, 'O');
text = text.replace(/UU/g, 'U');
text = text.replace(/YY/g, 'Y');
text = text.replace(/[AEIOUY]{2,}/g, 'E');
text = text.replace(/[AEIOUY](?! )/g, 'ER');
text = text.replace(/[Y]/g, 'ER');
text = text.replace(/ERH/g, 'ER');
text = text.replace(/ERR/g, 'ER');
text = text.replace(/MER/g, 'MAH');
text = text.replace('ERWERSERMAH', 'ERSUM');
text = text.replace('ERWERSERME', 'ERSUM');
text = text.replace('GERSERBERMPS', 'GERSBERMS');
text = text.replace('MAHMAH', 'MERM');
text = text.replace('MAHME', 'MERM');
$(this).replaceWith(text);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment