chadscira
await asyncFuncOne();
await asyncFuncTwo();
No more weird water-falling, and finally proper exception handling. The only gotcha is the fact that we cant awaits at the root of a module, and we need to wrap it in a async function.Even with paper ballot we still have to trust the people/devices counting the votes.
As an American citizen theres no website I can go to and check my vote. How do I know it was even counted, or properly registered.
Also wanted an excuse to play with a few browser features :P.
I find myself often needing a quick way to generate a Data URI when playing with files on jsfiddle, or codepen (due to CORS). So I thought it would be nice to have a website that locally stores those files.
This was thrown together in a couple of hours (using react/mobx), and inspired by [0] "The XSS Game By Google post". It turned out that quite a few people didn't know that you could use URI's for things that were not images.
If you have any suggestions feel free to voice them :)
It locally stores the files as well, click on the hamburger menu to see them.
- drag & drop
- manual upload
- paste
- custom file creation
- local storage
Show HN: Data URI Generator
We need the gates foundation to donate a billion, that should get us 31 years on the clock.
Here is a example of 5M
data:text/html,<script>window.location='data:text/html,<!--'+new Array(5000001).join('a')+'!--><script>document.documentElement.innerHTML=window.location.protocol+\':\'+String(window.location).length;</'+'script>';</script>
I tried 110Mb and it actually worked as well! I'm not sure about the real limit.You can store MASSIVE amounts of data in these things. It also seems to eventually break the url display and reverts to about:blank. It still retains protocol integrity though.
data:text/javascript;base64,YWxlcnQoMSk=
I didn't know you could do stuff like this (not for XSS) data:text/html,<script>alert(window.location)</script>
Cool, you can store a whole website in a URL now.You should checkout ranchers channel for some videos: https://www.youtube.com/channel/UCh5Xtp82q8wjijP8npkVTBA
It's mind-blowing that they offer this for free, considering the impact it has.
Feels safe enough for our needs. Before this we didn't have 10 minute snapshots of all our data so this has actually allowed us to recover from dev errors as well (if they were to happen).
We do have our DB running in a container + mounted volumes that use the above configuration.
It's been smooth sailing.
Because of massive costs savings we were able to just reinvest it in our own redundancy. Also 12-factor apps are pretty damn resilient.
So the take away is Go is better at handling massive amounts of open outgoing network calls.
In Node.js you want to restrict this to prevent the server from choking. If they did that I bet performance would be very similar.
I have had node do 12000 requests a minute with no problem (on a single core). In this case they had 4 two core boxes, so they needed each one to at least perform 42 requests a second under max load.
I want to know more :)
Don't spawn off heavy requests without a throttle / queue, or else you will overload your single core.
We normally don't think about this because most requests are just tiny queries / small http requests.
This is a valid comment considering that the EC2 instance mentioned is a 2 core box, and there is a possibly that the node implementation didn't take advantage of both cores.
- Go has multi-core support out of the box
- Node.js has to be shown a little love, and has limitations. But this would have been a great use-case for Cluster.
If the Node implementation was using all cores, then I wouldn't have asked this question. As it stands I don't really know what we are comparing even with all the graphs.
Also we are still missing a little info on how they handled the requests. When you have a endpoint on a node server that is not a simple one, it is best to queue those before handling them (yes a additional queue). This prevents the process from choking because it just opened up NNN requests to S3.
Most developers are not working with hundreds of HEAVY requests a minute, but in Node.js this usually has to be handled with care, and does not work out of the box.
But if you want to pick up a shinier hammer then Go for it.
Server-side rendering fixes the issue of time to first pixel. I think we don't really need to worry about a 10KB bump, especially considering how many websites are serving ads to mobile which are sending over MUCH MORE DATA.
I have been traveling around to many 3rd world countries, and when I hit a website thats loading a little slow you know what I do? I wait for it to finish loading, or I refresh. One of the biggest things a site can do to improve speed is picking a good CDN (Cloudflare).
If the browser is locked over X seconds it will actually tell you that the script is unresponsive, and ask if it should stop it. But you can of course work around this, and disable it in your browser of choice (http://www.reginout.com/nflp/fix-unresponsive-script-error-i...). Or you could just use a webworker, and not lock the UI.
From my experience though there is a small overhead in terms of workers, also the message cost. But still even if it was 300% slower it's justified because it is unacceptable to lock the browser.
Too many commenters here are coming from the backend, or desktop software where they already have a UI thread. I ask these commenters a simple question, when is the last time you saw your browser freeze? If that doesn't happen often then the devs are doing many things like this to keep that experience enjoyable. Web is it own kind of beast in terms of development, the biggest concern is perceived responsiveness. We get to write off async delays when using webworkers (and similar methods) because users are already used to network requests taking time.