r/javascript • u/346pm • Nov 24 '17
large image I am the best webdev
Don't blame me for being awesome
(function r() {
setTimeout(r, Math.random() * 10);
let el = document.createElement(`div`);
el.innerHTML = `๐`;
el.style.position = `absolute`;
el.style.zIndex = 999999;
el.style.fontSize = (((Math.random() * 48) | 0) + 16) + `px`;
el.style.left = ((Math.random() * innerWidth) | 0) + `px`;
el.style.top = ((Math.random() * (innerHeight + pageYOffset)) | 0) + `px`;
document.body.appendChild(el);
})();141
171
Nov 24 '17
156
u/346pm Nov 24 '17 edited Nov 25 '17
Stop stealing my code this is worth zillion ๐ฒ and copyright by meโขยฉ
48
Nov 24 '17
97
u/346pm Nov 24 '17 edited May 21 '26
OK guys, since all of you are thiefs, the most recent version is now obfuscated.
(function a(){setTimeout(a,0xa*Math['random']());var b=document['createElement']('div');b['innerHTML']='๐ฝ';b['style']['position']='absolute';b['style']['zIndex']=0xf423f;b['style']['fontSize']=(0x30*Math['random']()|0x0)+0x10+'px';b['style']['left']=(Math['random']()*innerWidth|0x0)+'px';b['style']['top']=(Math['random']()*(innerHeight+pageYOffset)|0x0)+'px';document['body']['appendChild'](b);}());25
Nov 24 '17
4
u/kunokdev Nov 24 '17
Wow this is amazing, what is that? How do you generate such code and why does that work?
13
u/cmgriffing Nov 25 '17
It is called JSF**k. This article about how eBay is/was vulnerable to code injection might help explain things: https://arstechnica.com/information-technology/2016/02/ebay-has-no-plans-to-fix-severe-bug-that-allows-malware-distribution/
7
6
u/invisibo Nov 25 '17
Feature request: random sounds to be played when the div element is written to the DOM. Can be web audio sin waves or a fart sound.
23
u/52358 Nov 25 '17
but what if the ๐ were rotated and semi transparent?? https://codepen.io/felixmc/pen/LOrwLr
5
3
1
37
Nov 24 '17
If you use linear feedback shift registers and hold the eggplant size constant, then you can randomly fill the document entirely without any eggplants overlapping. Much like the way blood would gradually populate all pixels randomly when you died in the original Wolfenstein.
47
u/346pm Nov 24 '17
We are planning to add this as an free option, which can either be purchased or retrieved by viewing our free online ads for ~40 hours.
0
Nov 24 '17
[deleted]
15
Nov 25 '17
โ๏ธ The intent โ๏ธ is to provide ๐๐จ players with a sense of ๐ช pride ๐ช and ๐accomplishment ๐ for ๐ unlocking ๐ different ๐ heroes ๐ As for ๐ฐ cost ๐ฐ , we selected initial values based upon ๐ data ๐ from the Open Beta and other ๐ง adjustments ๐ง made to milestone ๐ฐ rewards ๐ฐ before ๐ launch ๐. Among other things, we're ๐ looking ๐ at โ๏ธ average โ๏ธ per-player ๐จ ๐ฉ credit ๐ธ earn rates ๐ on a daily basis ๐ , and we'll be making constant adjustments ๐ง to ensure that players ๐จ๐จ have challenges ๐ค that are compelling ๐, rewarding ๐ฐ, and of course attainable ๐ via gameplay ๐ฎ We appreciate the candid ๐ feedback, and the passion ๐ก the community ๐จ ๐จ ๐จ has put forth around the current topics here on Reddit๐ป, our forums ๐ and across ๐ numerous ๐ social media outlets ๐ Our team ๐จ๐จ๐จ๐จ๐จ will continue to make ๐ง changes ๐ง and monitor ๐ community feedback and update everyone as soon ๐ and as ๐ often ๐ as we can. ๐
6
19
u/swan--ronson Nov 24 '17
Requires Unicode 6.0 support, which I currently don't have as an edgy Linux haxxor. 2/10 m8.
61
u/346pm Nov 24 '17
We are not responsible for people who are too dumb to understand windows. Won't Fix
5
u/CodeTheWebBlog Nov 25 '17
WHY????? Windows is the worst. I had faith in you before this...
11
u/gelezinislokys Nov 25 '17
LMFAO. Both Linux and MacOS is dead thing. Barely anyone uses it, WinXP > everything else.
24
u/Casey_works Nov 24 '17
I sent this to everyone in my office, but in stealth mode. Thanks.
(function r() {
setTimeout(r, Math.random() * 10);
let el = document.createElement(`div`);
el.innerHTML = '🍆';
el.style.position = `absolute`;
el.style.zIndex = 999999;
el.style.fontSize = (((Math.random() * 48) | 0) + 16) + `px`;
el.style.left = ((Math.random() * innerWidth) | 0) + `px`;
el.style.top = ((Math.random() * (innerHeight + pageYOffset)) | 0) + `px`;
document.body.appendChild(el);
})(); 35
1
1
22
u/Is_At_Work Nov 24 '17
Needs more jQuery
18
2
u/chneau Nov 25 '17
Here you go
r=Math.random;setInterval(()=>$('<div>๐</div>').css('position','absolute').css('zIndex',999999).css('fontSize',((r()*48))+16).css('left',r()*innerWidth).css('top',r()*(innerHeight+pageYOffset)).appendTo('body'),r()*10)
19
u/BlueHeartBob Nov 24 '17
how do i install via npm?
43
Nov 24 '17
npm install ๐ --savebut brace yourself for about a million libraries overhead
0
Nov 24 '17
[deleted]
11
17
u/moneckew Nov 24 '17
Hi, im interested in buying this software for our enterprise. Are you considering selling?
22
15
7
u/amgin3 Nov 25 '17
Why are you using Math.random()*10 on the setTimeout? The value will always be less than 10 milliseconds, too fast for any randomness to be noticeable. Just use a constant number if you're going to have it so fast and save some overhead.
2
u/gelezinislokys Nov 25 '17
And if you do it that fast, just use raf
6
Nov 25 '17
Also, Math.random does not provide cryptographic-grade randomness which is essential for this kind of app. An end user might well be able to predict future positions in advance.
0
6
u/Le_9k_Redditor Nov 24 '17
Ok so you're saying I should put this in a major project and have it set to only go off on april the first?
6
5
4
4
u/enchufadoo js truck driver Nov 24 '17
TIL I can read code and see it like a musician reads sheet music and hears it.
3
u/scrogu Nov 25 '17
I added random rotation:
(function r() {
setTimeout(r, Math.random() * 10);
let el = document.createElement(`div`);
el.innerHTML = `๐`;
el.style.position = `absolute`;
el.style.zIndex = 999999;
el.style.fontSize = (((Math.random() * 48) | 0) + 16) + `px`;
el.style.left = ((Math.random() * innerWidth) | 0) + `px`;
el.style.top = ((Math.random() * (innerHeight + pageYOffset)) | 0) + `px`;
el.style.transform = `rotateZ(${Math.random() * 360}deg)`
document.body.appendChild(el);
})();3
u/iroxjsr0011 Nov 25 '17
For those who want to see multicolored ๐ here
(function r() {
setTimeout(r, Math.random() * 10);
let el = document.createElement("div");
el.innerHTML = `๐`;
el.style.position = `absolute`;
el.style.zIndex = 999999;
el.style.color='#'+(Math.random()*0xFFFFFF<<0).toString(16);
el.style.fontSize = (((Math.random() * 48) | 0) + 16) + `px`;
el.style.left = ((Math.random() * innerWidth) | 0) + `px`;
el.style.top = ((Math.random() * (innerHeight + pageYOffset)) | 0) + `px`;
document.body.appendChild(el);
})();5
2
2
1
1
u/mcfrankline Nov 25 '17
/u/tippr gild
2
u/tippr Nov 25 '17
u/346pm, your post was gilded in exchange for
0.00154572 BCH ($2.50 USD)! Congratulations!^^Howย toย use | ^^Whatย isย Bitcoinย Cash? | ^^Whoย acceptsย it? | Powered by Rocketr | r/tippr
Bitcoin Cash is what Bitcoin should be. Ask about it on r/btc
1
1
1
1
u/sylario Nov 25 '17
From what I understand it should recursively call itself infinitely without ever reaching the third line. What am i missing?
1
u/_poor Nov 25 '17
setTimeout places the callback to the side (event queue) and execution will continue as normal. The recursive call you mention will only happen after the code which is currently executing finishes, in addition to the duration passed to setTimeout.
1
1
u/nikaone Nov 25 '17
I copycat from all of you, and add a Japanese meme, https://codepen.io/jacobsun/full/POBZJr/ ,
1
1
u/batmansmk Nov 24 '17
Purple rain, purple raiiiin!
1
u/atomic1fire Nov 25 '17
Nah dude, this should be purple rain.
3
u/CodeTheWebBlog Nov 25 '17
Its still blue, you should use a filter: https://codepen.io/Booligoosh/pen/wPXbqd
That's better
1
0
-2
u/nightness Nov 25 '17
Best is subjective. Best because you can make a nice solution in a short period of time, or because you make the best solution in a reasonable about of time.
0
0
Nov 24 '17
[deleted]
11
u/Soccham Nov 24 '17
I think it needs more
20
u/Le_9k_Redditor Nov 24 '17
Eggplant enterprise edition
5
u/grantrules Nov 25 '17
Free for open source projects, 10-100 user installation with enterprise support for $2,500/mo + $10/mo/install
8
u/evenisto Nov 25 '17
What is this const and arrow stuff? This feature is critical and it needs to support legacy browsers as well. We need battle-tested syntax and solutions.
10
u/_poor Nov 25 '17
Our Babel ES6 rollup parmesan webpack gulpify stage-0 broccoli step should transpile the code to work on legacy browsers... I think
6
u/evenisto Nov 25 '17
Transpilation? No, that's out of the question. We settled for straightforward deployment strategy of putting it in a <script> tag, we have already trained our team and we don't want it all go to waste.
0
Nov 25 '17
[deleted]
3
u/sunsetfantastic Nov 25 '17
This is fantastic
Although I can't see a lot of changes, the code is very similar
0
0
3
Nov 25 '17 edited Nov 25 '17
[removed] โ view removed comment
3
u/TheHelgeSverre Nov 25 '17
It's what the young ones calls an "Emojii" (unicode), watch this, it explains it well: https://www.youtube.com/watch?v=tITwM5GDIAI, the eggplant specifically: https://emojipedia.org/aubergine/
1
Nov 25 '17
[removed] โ view removed comment
2
u/TheHelgeSverre Nov 25 '17
Yes ๐, it is just a character, just like - %, & or โ
1
Nov 25 '17 edited Nov 25 '17
[removed] โ view removed comment
2
u/TheHelgeSverre Nov 26 '17
No there is no trickery, โ โ โ โ โ โ โ โ โ โ just try to copy paste this character into notepad, it is just as valid of a character/letter as "A" or "?"
1
88
u/[deleted] Nov 24 '17
Man, I love eggplant. What a great vegetable. Can I put, let's say, $11M into your Series A?