How do I link to a specific post? This one by mxfh looks very cool: d=x.getImageData(0,0,w=c.width=256,h=144);for(i=0;i Does anyone know how it works?
Dwitter – A social network for short JavaScript demos
41–50 of 74 posts
Re: Dwitter – A social network for short JavaScript demos
#42Earlier quoted context omitted.
I tried to register as "sfz-" and also got a 500. Is there a problem with a trailing dash? If so, can you fix my username as well to "sfz"? Thanks!
Changed to sfz :)
Re: Dwitter – A social network for short JavaScript demos
#43Re: Dwitter – A social network for short JavaScript demos
#44Interestingly, I found that some scripts really don't like using eval(), so I modified the page to dynamically swap in new elements with the code instead, and a flag to go back and forth.
Here's an example of a script which doesn't like eval() - it runs noticeably faster when embedded in a script: https://www.dwitter.net/d/697
Edit: Added the ability to just embed the code in the URL: http://www.russellbeattie.com/dwitterish.html#c.width%7C%3D0...
(Note that I only tested this on Chrome, so feel free to modify if there's issues.)
Re: Dwitter – A social network for short JavaScript demos
#45This is really cool, but executing other people's javascript in a page makes me nervous. What sort of restrictions are in place to prevent malicious exploits?
Makes me quite nervous too. So far each dweet is run in a sandboxed iframe loaded from a separate subdomain. There are definitely things you can do, and I'm aware of some annoying ones. I'll just manually delete them at this point. Any security conscious person would view it with noscript and just read the javascript ;)
Re: Dwitter – A social network for short JavaScript demos
#46This is really cool, but executing other people's javascript in a page makes me nervous. What sort of restrictions are in place to prevent malicious exploits?
Makes me quite nervous too. So far each dweet is run in a sandboxed iframe loaded from a separate subdomain. There are definitely things you can do, and I'm aware of some annoying ones. I'll just manually delete them at this point. Any security conscious person would view it with noscript and just read the javascript ;)
A system to automatically hide dweets (for later manual review) after receiving a certain number of reports would likely solve the problem in the short term.
Re: Dwitter – A social network for short JavaScript demos
#47Re: Dwitter – A social network for short JavaScript demos
#48Re: Dwitter – A social network for short JavaScript demos
#49Re: Dwitter – A social network for short JavaScript demos
#50I'm not understanding this. How is animation happening? What is S(t)? Can somebody please explain this project?
u(t) is called 60 times per second.
t: elapsed time in seconds.
c: A 1920x1080 canvas.
x: A 2D context for that canvas.
S: Math.sin
C: Math.cos
T: Math.tan
R: Generates rgba-strings, ex.: R(255, 255, 255, 0.5)