Skip to content

Instantly share code, notes, and snippets.

@DoggettCK
Created June 20, 2012 20:04
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 DoggettCK/2961880 to your computer and use it in GitHub Desktop.
Save DoggettCK/2961880 to your computer and use it in GitHub Desktop.
Hodor
// ==UserScript==
// @name Hodor
// @namespace gamerswithjobs
// @description Makes everything sound the same
// @exclude /github/
// @author Chris Doggett
// ==/UserScript==
// Special thanks to Jeremy Banks at http://stackoverflow.com/a/6834930/64203
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})};
load("//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js",
function(event) // Great success!
{
loadAndExecute("//raw.github.com/cowboy/jquery-replacetext/master/jquery.ba-replacetext.js", main);
},
function(event)
{
// something happened when loading jQuery from Google
})
function main()
{
$("body *").replaceText(/\w+/gi, "Hodor");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment