Lurker News
Made this website as an exercise in vibe-coding and GCP. It was posted about a few times around the internet, on sites like Morning Brew (https://www.morningbrew.com/issues/business-buzzkill), MetaFilter (https://www.metafilter.com/209703/Draw-A-Fish), boingboing.net, etc. I think it's cute!

I built a basic CNN trained against penises and swastikas, and then anything that doesn't hit the 63% confidence score gets sent to a mod queue, a vibe-coded fish-tinder (https://bsky.app/profile/bigass.bsky.social/post/3luvikxn3f2...).
Was a fun exercise, spent about a month on it. Frontend is HTML5 hosted on github pages, backend is Node.JS on GCP.

Comments (234) 108 threads

Earlier comments
amitp#
Suggestion: canvas.addEventListener('dragstart', (e) => { e.preventDefault(); } );

At least on Firefox/Mac, sometimes while dragging it "picks up" the image to drag it. This should prevent that.

rafram2 replies#
> exercise in vibe-coding

The code shows it... Your escaping routine seems OK, but you really __should not__ be building HTML and JS(!) using raw string interpolation. Or letting the client decide whether the submission needs moderation.

hallak1 reply#
I don't let the client decide whether the submission needs moderation :)

There's a very slightly different model in the backend that sends things to the mod queue. Strings are also sanitized there. But copilot really wanted to add all that logic to the frontend too and I thought it was funny

rafram1 reply#
You still should not be building HTML and JS using string interpolation.
hallak1 reply#
Absolutely! I've removed all references of HTML and JS using string interpolation.

(jk)
This is definitely a drawback with with vibe-coding. I never really write like HTML5 style code - at work I always use typescript with heavy ESLint, so never have to worry about this.
I figured the string sanitization in the backend would take care of any XSS vulns, which was my main concern. But I will have to read into the dangers of string interpolation which I admit I do not remember too much about (outside of the XSS stuff I tried to mitigate).
Thanks for giving the opportunity to learn... :)

Continue this thread — 1 reply

hyperhello1 reply#
To be fair, everything on the client is raw string interpolation. It's only secure if you comprehensively vet everything once it's on the server.
rafram2 replies#
That's absolutely not true. Sanitization on the client is significantly safer, because the client knows how it parses HTML, while the server can, at best, guess (and hope it follows the spec).

When you set element.textContent = someUserGeneratedContent, the browser guarantees that the user-generated content will never be parsed as HTML.
response.write("" + sanitize(someUserGeneratedContent) + "") has no such guarantee.

hyperhello#
If that’s all you want, it’s trivial to replace all < and & with their encodings.
Aachen#
That's not sanitisation, that's separating data from executable code. It's a better solution when possible, but the solution suggested above also works
volkk5 replies#
I did this on a trip to Japan but can't remember for the life of me where. Some museum. My wife and I drew fishes and then they were uploaded and we went to a room and watched them swim across walls/ceilings. Really cool experience
zedstar1 reply#
Teamlabs - Borderless, I also did the same : )
volkk#
yep that was it!
romanhn#
Our family did this recently as well at teamLab Planets in Tokyo. I filled out a circular template with a very creepy looking "smiley" face. The template turned out to be for raindrops. I couldn't stop giggling when hundreds of my monstrous creations filled the room, it was very fun.
neumann#
The Singapore ArtScience museum has this concept. Templated sea animal colour in pages that a guide vetted before scanning and then your fish appears on the walls of the dark room in a sea life picture swimming with all the other fish. It was pretty cool. A variation in the other room was the same deal but with flying machines, but this time they gave you a remote control that controlled specifically your creation as it flew around on the landscape projected onto the walls.
evan_1 reply#
I couldn’t get it to go above 50% and then I wrote “fish” on it and it went up 5 points
WangComputers#
I gave my blue fish a black Hitler mustache and it went up by ten points

Load more comments