Category talk:Snippets with JavaScript

I have found a JavaScript snippet quite useful, but I'm missing a good advice where to put the code. Which file? And how do I save the change, when upgrading Mediawiki? --&#91;&#91;User:Bmrberlin&#124; Bernd M.&#93;&#93; (talk) 07:51, 15 April 2015 (UTC)