💾 Archived View for tilde.club › ~oldernow › 2023-10-30-05-44-48.gmi captured on 2023-11-14 at 08:01:36. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-11-04)
-=-=-=-=-=-=-
As is my tendency, I spent a bunch of time yesterday agonizing over post format, which included matters like:
And so on.
And of course none of that is absolutely necessary, but simply tends to grate on me over time if/when discovering I wish I'd done any of that differently, and of course will want to blow time/effort on making past posts conform to what I wish I'd gotten "right" in the first place.
Perhaps that attitude is good for software development. But it can rather suck for mental/emotional health.
I just deleted several paragraphs of motivation details, but suffice it to say there are times when I'd rather the rest of the world not know when I'm writing a post.
That occasional need led to writing the following Lua script, which loops on clearing the screen after taking a line of text on standard input, depositing each gulped line in a file specified as a first argument. (A second argument tells it to complete those lines with two newlines instead of the default of one, because sometimes I want those saved lines to be separated by blank lines.)
It's hardly perfect, but pretty gosh danged useful when it seems being seen to be writing a post might trigger misunderstanding.
#! /usr/bin/env lua local eol = '\n' if arg[2] then eol = '\n\n' end local out = nil if arg[1] then out = io.open(arg[1], 'a') if not out then print('=== could not open file for write: "' .. arg[1] .. '"') os.exit() end else print('=== missing filename argument') os.exit() end while true do os.execute('clear') local line = io.stdin:read() if line then out:write(line .. eol) else break end end