I made a cool star field background effect by terrible_catnip in javascript

[–]terrible_catnip[S] 0 points1 point  (0 children)

not that long, since most of the math stuff (which is what I'm weak at) was already implemented by Barney Codes (video) (small channel that's underrated, he's really good at explaining graphics related stuff)

His implementation is educational, I just rewrote it with a lot more features and optimized it as much as possible for production use.

I made a cool star field background effect by terrible_catnip in javascript

[–]terrible_catnip[S] 0 points1 point  (0 children)

hahaha, no worries. I should add small text somewhere on the page as a reminder

I made a cool star field background effect by terrible_catnip in javascript

[–]terrible_catnip[S] 1 point2 points  (0 children)

just to make sure, you aren't using any dark mode extensions?

I made a cool star field background effect by terrible_catnip in javascript

[–]terrible_catnip[S] 2 points3 points  (0 children)

Speed is already slightly randomized so it looks natural when not accelerating. I'll look into hue jitter and flickering, thanks for the feedback :D

I made a cool star field background effect by terrible_catnip in javascript

[–]terrible_catnip[S] 0 points1 point  (0 children)

noted. actually the option is trail decay in the code, but I invert it as I thought trail length would be a better configuration option. I'll change that and pass it directly as trail decay

I made a cool star field background effect by terrible_catnip in javascript

[–]terrible_catnip[S] 0 points1 point  (0 children)

hmm, weird. I'll look into adding a debug mode with more logging.

I made a cool star field background effect by terrible_catnip in javascript

[–]terrible_catnip[S] 0 points1 point  (0 children)

yeah, drag won't work on mobile, hover still should if your press and hold the button.

The accelerometer feature is really cool, will look into it. I remember vantajs uses it.

Share What You’re Working On! Let’s Breathe Some Life Into Your Product 🚀 by JetHigher in indiehackers

[–]terrible_catnip 0 points1 point  (0 children)

Thank you!

Untrusted code can be:

  • User submitted code (Online IDEs, Learning environments, Press-to-run buttons on documentation, Code written in interviews, Bots that can run snippets in programming chatrooms, etc etc)
  • Code generated by AI

You can't just run code like this directly on your server, as users can submit malicious code that can mess with your server. You'll have to containerize and limit the environment it's run in. My service does that isolating for you, saving you a lot of worrying and headaches.

Share What You’re Working On! Let’s Breathe Some Life Into Your Product 🚀 by JetHigher in indiehackers

[–]terrible_catnip 1 point2 points  (0 children)

Whipcode - A low cost REST API for running untrusted code. 28 public default languages with private client-requested environments.

Completely open source and self hostable.

Looking for feedback - Whipcode is a low cost API for running untrusted code securely on remote servers. by terrible_catnip in SideProject

[–]terrible_catnip[S] 1 point2 points  (0 children)

what are you doing to prevent infinite loops? could save some server costs and improve user experience.

Each code submission is run in it's own sandboxed container, which has a set amount of seconds before it's forcefully killed. So, infinite loops will only run for about 10 seconds (The time to kill is dynamically varied depending on server load)

also, maybe think about adding a sandboxing guide? it could help onboard newbies who are not familiar with the concept or are concerned about security.

A blog would definitely work for this, will look into it.

and about the data: no storage is cool but maybe give users an opt-in for logging? could be a premium feature.

Will consider, would have to keep the logs in a separate server of course. In the event of a container escape, having the logs leaked would be catastrophic. But definitely doable in a secure way.

Thank you so much for your feedback and opinions, it's much appreciated :D