News for hackers. Stuff that matters.
Re:A file that's both an acceptable HTML page and a JPEG (vi... by daeken on Friday July 06, 2012 @03:14PM (#4209211)
Matraka is seriously worth a watch. All 2d canvas, and it actually has music in a 1k. What's funny is that p01 is the reason I got into web demo development, and he's actually using the png technique I came up with. Makes me proud to be a hacker.

Edit: It also won a much-deserved first place in the DemoJS 1k compo.

Re:A file that's both an acceptable HTML page and a JPEG (vi... by StavrosK on Friday July 06, 2012 @03:56PM (#4209354)
Wait, is it using the image data as code to evaluate? My mind is too blown to appreciate this.

EDIT: Oh, okay. It's not a valid PNG. That would have been all sorts of incredible. Still great, though.

Re:A file that's both an acceptable HTML page and a JPEG (vi... by tlack on Friday July 06, 2012 @06:03PM (#4209858)
I wrote up a little explanation of how it works here https://gist.github.com/3039247
Re:A file that's both an acceptable HTML page and a JPEG (vi... by StavrosK on Friday July 06, 2012 @07:16PM (#4210040)
Very interesting, thanks!

By the way, the for loop seems to be irrelevant to the invocation, (1,eval) just returns eval. (1,console.log)("hi") looks like it should work, except it raises an error. (1,2)+3 returns 5, however, and (1,console.log) returns the log function.

Re:A file that's both an acceptable HTML page and a JPEG (vi... by skrebbel on Saturday July 07, 2012 @11:18AM (#4211828)
it's a performance thing. i forgot the details, but if you change the `(1,eval)` to `eval`, it's all much slower. something with the scope of the code that's being eval'ed, if i recall correctly.
Re:A file that's both an acceptable HTML page and a JPEG (vi... by tlack on Saturday July 07, 2012 @04:41PM (#4212654)
(1,eval)('2*2') evaluates in the global context, so it may be slower I would think. Here's a really long and insanely detailed post about this odd feature: http://perfectionkills.com/global-eval-what-are-the-options/