NHacker Next on Rails
  • top
  • new
  • best
  • ask
  • show
  • jobs
login
GuidelinesFAQListsAPISecurityLegalApply to YCContact

Hacker News on Rails, powered by React on Rails Pro. Open the source on GitHub by ShakaCode.

Commit 06fc0df

Rendered at 09:46:49 GMT+0000 (Coordinated Universal Time) with Rails + React on Rails RSC.

Making a 88x31 button book using ImageMagick (k.sosnierz.me)

166 points by birdculture 3d ago | 32 comments

ninjalanternshk 22h ago
I think the title undersells the accomplishment.

He made an animated button gif that scrolls the entire text of Moby Dick.

4.2 Mb, 19 hours long.

Top quality useless proof of concept. 10/10.

coldpie 19h ago
Man, few things have made me feel like more of a philistine than reading Moby Dick earlier this year. I read a lot, but I've never considered myself a "literature guy" and wow Moby Dick cemented that. I did finish it, but I thought it was just an awful read, absolutely boring from start to finish. About halfway through I was just skipping pages and pages and pages of filler descriptions and incomprehensible 20-page-long speeches. I absolutely hated it, among the worst books I've ever powered through to the end.

It's definitely a "me problem," obviously people who are into literature and analysis get a lot out of it. But in future I'm gonna stick to my dumb sci-fi books where people talk in comprehensible sentences and things blow up, lol.

selfsimilar 18h ago
People like what they like, so if that's not your jam I wouldn't sweat it. That said, Moby Dick is perhaps a poor example of "literature" to start on if you're not sure you like "literature", mostly from being so long. If I might recommend trying Cosmicomics by Italo Calvino, or The Cyberiad by Stanislaw Lem, as they are easy to dip in and out of are nominally "sci fi" while still laying some claim to "literature". Lem and Calvino may lead you to Borges or PKD or Ursula K LeGuin or China Mieville - more genre artists that arguably aspire to being more than pulp.
sloum 18h ago
I definitely get it not being everyone's thing. But I really really love Moby Dick. It is so funny! My wife kind of prepped me for viewing a lot of it as comedy or humor, especially toward the beginning, and viewing it through that lens absolutely helped. The language is old enough that you sometimes have to realize that the author is being funny, but it is there. I really loved all of the information about whales... that is just not true. Wasn't even thought to be true at the time.
NetMageSCW 15h ago
I would definitely stay away from Alexandre Dumas then.
BoingBoomTschak 15h ago
I pretend to have a modicum of taste and while I didn't find it boring on the whole, there's a much smaller yet better novel that could be extracted from it. It's just way too self-indulgent and meandering at times.
Kye 19h ago
The promotion of "classic" literature is largely about exposing you to depictions of the lived experiences of others through history. You can probably find better sources for that these days. It doesn't have to be unbearable without going into it with a specific goal (like wading into muck to save a puppy), but it often is.
emil-lp 20h ago
Then I know what I'll do tomorrow!

19 hours. Don't blink.

Zobat 19h ago
Yep, but I'm inclined to say he went full "Jurassic Park" on that one.
unleaded 21h ago
Reminds me of the classic "P Diddy Calls Bjork" https://www.negrophonic.com/wp-content/uploads/2007/02/bjork...
Jakob 20h ago
Very nice article. Refreshing to see one liners and fun projects. And the website’s glamour mode is great, too.

Although, as tradition requests, any example of the useless use of `cat` (UUOC) must be called out. The _much_ more efficient use would of course be

  tr '\n' ' ' < input.txt | tr -d '\r' | fold …
coldpie 19h ago
These uses of cat aren't useless.

It improves readability. One reads shell commands from left to right, following the logic of each step in the pipeline individually. It makes sense to start with a file, then pipe that to command 1, pipe that to command 2, etc. It makes less sense to start with command 1 into which we put the file and then take the output of command 1 from before the file and put that into command 2 etc.

It also improves future editability. If you wanted to change the input to command 1, you go tweak the bit to the left of command 1 instead of having to hunt down where the < is stuck in the middle somewhere and potentially remove it and replace it with something off to the left anyway depending on whether it's a file or the output of some other command.

Using cat as the first step into a pipeline is almost always the right thing to do!

ktpsns 16h ago

   <input.txt tr '\n' ' ' | tr -d '\r' | fold …
is valid bash and does the same as cat input.txt | tr ...
aarmot 13h ago
And now your mentor arrives and demands you change one character to source all input*.txt files
cedilla 15h ago
How is avoiding a single invocation of cat much more efficient?

I feel if anything needs calling out, it's mistaking opinions for universal laws.

lifestyleguru 17h ago
> tr '\n' ' ' < input.txt | tr -d '\r' | fold …

I enjoy discovering and decrypting these one liners much more than reading about what someone's AI agent generated recently.

lubujackson 21h ago
Mostly useless but genius, hand-written text and code.

It is so, so refreshing and I love it.

aezart 4h ago
I attempted to open the resulting full gif using GIMP to see all the individual layers but unfortunately it crashes about 12000 frames into the loading process.
sodimel 1d ago
This is a really great article! It show some simple tools calls and is still very small (no long wall of text to read). Thank you!
noufalibrahim 19h ago
What a glorious combination of interesting, quick and absolutely useless. It's beautiful.
wartywhoa23 1d ago
I recommend enabling the Glamour mode. So hilarious in a good way :)
jaffa2 22h ago
I like it. Can we have a general glamour mode plugin for all web pages.
tarsierscripter 21h ago
I do really like this! I had never even heard of 88x31 buttons yet when presented with a few of them I got instant nostalgia for the “old web” of my youth.

I think it’s my age speaking again, but I would have preferred Arial for this, as it’s much more legible to me than the final bitmap font he chose. He could have simply sped up the animation to account for only fitting 11 words per page and kept the whole thing in a reasonable time (if 19 hours is reasonable to you).

skyyler 21h ago
Arial would not look good at three by five pixels per character, would it?
tarsierscripter 17h ago
The Arial example that only fit 11 words was much more readable than the final result with 4 tiny lines of a nearly illegible low res bitmap font!
K2h 20h ago
At bottom of article click link to load all of moby dick in a single GIF. To play on ios, long press and select ’play animation’.

ImageMagick was created and written in C by John Cristy (also known as Cristy) in 1987 while working at DuPont https://en.wikipedia.org/wiki/ImageMagick

Theodores 17h ago
I would like to cheat at this assignment, using an SVG file that has the whole book as an HTML foreignObject, that just scrolls by in its special way, to simply name the SVG file as a GIF, knowing that browsers just read the headers in a file, ignoring the file extension.

My cheated assignment would fool humans because they would assume the SVG was a GIF binary.

The file size would be significantly smaller.

This skill in being able to deceive and brazenly stick to the lie would make me perfect for a top job in government, big tech, automotive or 'space'.

tdhz77 20h ago
Reminds me about my attempt at the 1 kv club using wasm. Horrible choice all aroundc
vladde 21h ago
obligatory recommendation, the "The 88x31 GIF Collection: Part 1" https://cyber.dabamos.de/88x31/
anthk 10h ago
Get some video of it:

   ffmpeg -i book.gif book.mpv
jwilk 14h ago
(2024)
murni_ie 13h ago
bravo