On a related note, I got a pleasent surprise when I opened the Developer Console on Facebook.com: they present you with a giant red warningp[1] and block any code execution in it until you explicitly 'allow [your] account to be hijacked if I paste malicious Javascript'[2]<p>[1]: <a href="http://i.imgur.com/6UVaTen.png" rel="nofollow">http://i.imgur.com/6UVaTen.png</a><p>[2]: <a href="https://www.facebook.com/selfxss" rel="nofollow">https://www.facebook.com/selfxss</a>
By the way, we're going to penalize April Fools' jokes tomorrow so that they fall off the front page quickly. This isn't new, but we're going to be more systematic about it. The April 1 tech thing has become stale. If you guys see April Fools stories that we miss, flag them unless they're really particularly good.<p>People complain about HN's humorlessness, and they're right to a point. The trouble is that with a culture of humor comes a flood of lame humor. HN wants to optimize for intellectual curiosity, which wants higher signal/noise ratio. It's not that we're killjoys—we like jokes and laughing—it's that the signal/noise problem is hard.
One of my favourite ways to punish JavaScript developers who don't use `var` is to randomly hide a<p><pre><code> if (false) {
var GLOBALVAR;
}
</code></pre>
somewhere in the code.<p>It's fun (in a harmless fun kinda way, but you can also use some really dirty tricks to really hamper someone's work) to fuck up people's code - that's why I wrote Underhanded JavaScript. :P<p>EDIT:<p>Another fun one is to add `return`s to constructor functions.
For more, see the evil.js project: <a href="https://github.com/kitcambridge/evil.js" rel="nofollow">https://github.com/kitcambridge/evil.js</a><p>Also note that `string.split('').reverse().join('')` is not a very good way to reverse a string in JavaScript. See <a href="http://mathiasbynens.be/notes/javascript-unicode#reversing-strings" rel="nofollow">http://mathiasbynens.be/notes/javascript-unicode#reversing-s...</a>
Alternatively, put this in your code tomorrow to pre-empt all the April 1st bastards:<p><pre><code> Object.freeze(console)
</code></pre>
Or safe JS up entirely: <a href="https://gist.github.com/clux/3823024" rel="nofollow">https://gist.github.com/clux/3823024</a>
I did something similar in high school. You dropped a file named "System.java" into a Java project, which then intercepted all calls to System.out.println() and, for example, printed the text backwards, <i>very</i> slowly, or googled the text in Firefox:<p><a href="https://github.com/blinry/fake-java-println" rel="nofollow">https://github.com/blinry/fake-java-println</a>
A silly prank, but it makes me wonder: has anyone implemented an antivirus/anti-problem scanner for open source code? i.e. scan the source code on a git repository and report any suspicious code that matches known malicious patterns? Lint, but targeted at detecting likely security flaws and code injections.
This is pretty hilarious, would drive me nuts.<p>I once did a similarly annoying chrome extension just for fun: <a href="https://chrome.google.com/webstore/detail/annoying-typo-generator/mblbeacchfoblmckinmgeedilgncpfok" rel="nofollow">https://chrome.google.com/webstore/detail/annoying-typo-gene...</a><p>Randomly generates typo in inputs and text boxes.<p>Side note: Mihai, since I know you will be reading this, watch out if your arrays in LRTF are upside down ;)
There's the old C prank:
#define true false<p>.. but in reality, I had a serious issue with Qt once:
#ifndef TRUE
#define TRUE true
#define FALSE false
#endif<p>Now this screwed up some other library's similar definitions...
Yes kill your coworker's productivity by making her or him even more miserable when dealing with a bug. If you did this and I was your manager, at worst you'd end up on a PIP. If you want conduct a prank do something that doesn't frustrate the work they're paid to do.