Live data from Hacker News

Ask HN: What's your "it's not stupid if it works" story?

news.ycombinator.com

11–20 of 510 posts

Re: Ask HN: What's your "it's not stupid if it works" story?

#11
Generated HTML email newsletters from Excel (in 2004).

It was a big old-fashioned bookseller trying to compete with Amazon. Software and the web was locked down tight, but they opened a daily report in Excel, and I built a VBA macro that generated the necessary HTML and published the images to an FTP server. Turned a 2 day job into a 10 minute one.

Re: Ask HN: What's your "it's not stupid if it works" story?

#12
I had a GCP Cloud Run function that rendered videos. It was fine for one video per request but after that it slowed to a crawl and needed to shut down to clear out whatever was wrong. I assume a memory leak in MoviePy? Spent a couple of days looking at multiple options and trying different things, in the end I just duplicated the service so I had three of them and rotated which one we sent video renders to and do each render one at a time. It was by far the cheapest solution, means we processed them in parallel rather than serially so it was faster, all in all it worked a treat.

Re: Ask HN: What's your "it's not stupid if it works" story?

#13
I was part of a team which had to make web interactives for an old desktop-only Java-based CMS which published out to HTML. This was back before cross-publishing to formats like Apple News was important; we only had to worry about things working on the browser version.

The CMS didn't support any kind of HTML/JS embed, and had quite a short character limit per "Text" block. But luckily, that block didn't filter out _all_ inline HTML - only some characters.

So, a bootstrap "Loading" element was inserted, along with a script tag which would bring in the rest of the resources and insert those in to the page where the bootstrap was placed. This quickly became a versatile, re-usable loader, and allowed us to launch the features. But all this grew from a very inelegant hack which just happened to work.

Re: Ask HN: What's your "it's not stupid if it works" story?

#14

`sed` text files as a replacement for templating. In the text file you have something you want to template (or "parametrize") from an outside variable, so you name that something like @@VAR@@ and then you can sed that @@VAR@@ :-)

Wait, you're telling me this isn't a Best Practice™?

Re: Ask HN: What's your "it's not stupid if it works" story?

#16

I worked at a startup where the core backend was 1 giant serverless Function. For error handling and recovery, the Function ran in a while loop. For all its faults, it worked and it was generating revenue. Enough that the startup got to a sizable Series A. That experience completely changed how I think about writing code at startups.

"on error resume next" never died, it just became serverless!

Re: Ask HN: What's your "it's not stupid if it works" story?

#17
post #2

It's not the best story - I'm sure there are some greats here - but I tricked GitLab into running scripts that looked like https://gitlab.com/jyavorska/c64exec/-/blob/master/.gitlab-c... by modifying a runner to pass everything through the VICE Commodore BASIC emulator. It would even attach the output file as an artifact to the build.

That’s incredible! Why though??

Re: Ask HN: What's your "it's not stupid if it works" story?

#18

I had a GCP Cloud Run function that rendered videos. It was fine for one video per request but after that it slowed to a crawl and needed to shut down to clear out whatever was wrong. I assume a memory leak in MoviePy? Spent a couple of days looking at multiple options and trying different things, in the end I just duplicated the service so I had three of them and rotated which one we sent video renders to and do eac…

This reminds me of a service I recently found that was routinely crashing out and being restarted automatically. I fixed the crash, but it turns out it had ALWAYS been crashing on a reliable schedule - and keeping the service alive longer created a plethora of other issues, memory leaks being just one of them.

That was a structural crash and I should not have addressed it.

Re: Ask HN: What's your "it's not stupid if it works" story?

#19

I had a GCP Cloud Run function that rendered videos. It was fine for one video per request but after that it slowed to a crawl and needed to shut down to clear out whatever was wrong. I assume a memory leak in MoviePy? Spent a couple of days looking at multiple options and trying different things, in the end I just duplicated the service so I had three of them and rotated which one we sent video renders to and do eac…

What you call a hack everyone else calls devops :-). You have higher standards!

Re: Ask HN: What's your "it's not stupid if it works" story?

#20
Monkey patching vendor code. They agreed their code didn’t work and produced wrong results, but the correct version would be slower, so they didn’t want to change it.

So I dynamically replaced the part of their code that was wrong. That monkey patch has run years and is still going :)

Post reply on HN