HNHacker News
TopNewBestAskShowJobs

lewiscollard

728 karma · joined August 28, 2015

Django by day, petrolhead by night, cat BFF all the time - root@lewiscollard.com - https://exhaust.lewiscollard.com/
submissionscomments
lewiscollard··on Show HN: I made a service to convert WordPress blogs to Hugo
You copy it into the same directory as the post you want to put it in, and reference it as a resource from your post. I made a shortcode for this for my own Hugo site, adding auto thumbnailing & WebP support:

https://gist.github.com/lewiscollard/c6651648d1c20144ed89e16...

Copy that into your "layouts/shortcodes/image.html" and use it as

    {{< image src="my cat.jpg" alt="add a description here" >}}
If you just want to upload it to _not_ reference it in a post/page, copy it into your `static` directory and it'll be passed through when the site is built.

Hope that helps!

lewiscollard··on Please don't force dark mode
Then un-mess them up :)

  html {
    filter: invert(1);
  }

  img {
    filter: invert(1);
  }
Bookmarklet edition:

    javascript:(function(){var s=document.createElement("style");s.innerText="html{filter: invert(1);}img{filter: invert(1);}";document.head.append(s)})()
(doesn't and can't fix CSS "background-image" but you'll live)
lewiscollard··on lc: List files in categories (and columns) – from Coherent Unix clone
<3
lewiscollard··on lc: List files in categories (and columns) – from Coherent Unix clone
There's also one in this PR now :) Saying I'm going to do something is more likely to get it done than just thinking about it! https://github.com/gdm85/lc/pull/1/files

But, yes, that is the manual page I converted from (actually I grabbed it from the tarballs linked in the README - should be the same thing). My entire experience of troff would fit on the inside of a Rizla packet with some space to spare, but looking at the original I think it was using some special macro package that doesn't exist on modern systems. So I re-wrote it to use `-man` macros as best I could, but also included the original man page source for anyone that thinks they can do a better job in future.

lewiscollard··on lc: List files in categories (and columns) – from Coherent Unix clone
Not author, but lc was posted on HN some years ago and at the time I was like "oh, I should really port over the original man page some day". After which I half did it, then forgot about it. I'm commenting here to commit myself to actually finishing that!
lewiscollard··on Where can you go in Europe by train in 8h?
Yes, I find it difficult to understand why anyone old enough to remember what British Rail actually was (or capable of e.g. reading Wikipedia, to find out what it was), would like British Rail to be resurrected in anything like the form it had. It feels like pointless nostalgia most of the time; double arrows, rail blue, and jumpers for goalposts.

And like, if one's model for maintaining a system depends on having a sensible government in power, _regardless of which particular political party you think is least competent_ you are going to have a rail system being run incompetently at least half the time. That's also what we got with "privatisation", of course; why would we expect any different?

lewiscollard··on Ask HN: How do you improve your writing?
If I may hijack your reply for a recommendation thread, I'd recommend "The Sense of Style" by Steven Pinker, too. It's worth it just for the section on metaconcepts. I loved how much simpler my writing became when I removed them.

Also, read anything by Robert Graves. He did write a style guide called "The Reader Over Your Shoulder", but that's optional; I learned far more about good writing from "I, Claudius" and "Good-Bye to All That".

lewiscollard··on Jennifer in paradise: the story of the first Photoshopped image (2014)
> I see this as a net positive. We are counterintuitively rediscovering skepticism by democratizing nation-state propaganda.

I think you've just described converting a high-trust society into a low-trust one, and I am inclined to think that this is not a good development. That might result in some healthy scepticism of authority, but it'll also get you a thousand Alex Jones and two thousand No Plane Theories.

> I believe this is a printing press moment, where truth will be spoken to power once again. I just hope we avoid the bloodshed that that the printing press wrought.

I, too, would like all of the possible good things and none of the possible bad things from any given technological change. Hoping for that won't help much; it might be good, might suck, or somewhere in between and we find some way to muddle through.

lewiscollard··on Next-generation web framework Teo, supports Node.js, Python and Rust
The primary author is not a native English speaker; he resides in China. It's more charitable to assume a literal translation that doesn't work well in English than presumptousness.
lewiscollard··on Cancel Adobe if you are a creative under NDA with your clients
https://imgz.org/i8CEMAJq.png

Create a transparent layer. Paint on it in a colour of your choice. Set layer mode to "darken only" or "lighten only" depending on your background. "Difference" is fun too.

I've been using GIMP for longer than I care to remember and I am painfully aware of what is not great in its UI, which is something that seems to have gotten _worse_ over time. This isn't one of them; to paraphrase, that's just knowing how to use basic features that GIMP and other programs have had since the 1990s.

lewiscollard··on Windows 10 wallpaper was physically built and photographed (2015)
(Disclaimer: no special insights into what Microsoft was doing at the time; I merely lived in the same era.)

I'd call it an artifact of only having 16 colours to work with when SETUP boots. Obviously, most machines at the time had more to work with than that, but VGA - which is to say, 16 colors at 640x480 - was the baseline. And remember that Windows 95 could be installed from _floppies_; looking fancy is good, but you don't want to gratuitously use disk space. No multiple versions of the same image for you!

Let's take this fancy "Mac with some other random shit on a desk" image from Unsplash:

https://unsplash.com/photos/black-and-white-self-balancing-b...

Here's what it looks like with various ways of reducing it to 16 colours:

https://imgz.org/iC7KufjC.jpg

(I know, the images are small on a modern display! Each square is full-size, because we're VGA.)

Top left is the original, obviously. Top right is what happens if you just reduce it to 16 colours; it looks like nothing in particular, and it weighs in at 153K (exported in a modern graphics editor), or more than a tenth of a 3.5" floppy disk. Bottom left is what happens if you do it with dithering; you can make it look like you have more colours than you actually do, but it also weighs 153K.

And bottom right is SETUP.BMP. It only uses _two_ colours from the palette ("0, 0, 255" blue and black). That's 1-bit colour which means my SETUP.BMP when exported to an actual BMP only takes up 38.5 kilobytes.

So the answer to your question, I suppose, is "use as few colours as possible and don't waste disk space" or "dithering" or "the 90s", but often the technical limitations of a period plus time become an aesthetic.

lewiscollard··on Ente: Open-Source, E2E Encrypted, Google Photos Alternative
> The intersection of people that care about open source and people that want to backup their photos also seems really minuscule.

This seems like a lack of imagination, which is not to be confused with any deficiency of the software or its business model. As for me, I think this completely rules.

lewiscollard··on PEP 701 – Syntactic formalization of f-strings
I understand this. Some part of me also resisted them until I worked out that, if used consistently, they _entirely_ eliminate format string bugs (of the "a user-supplied string contains string formatting characters" variety). And then I was a convert!
lewiscollard··on Expand Everything: Userscript to click "show more" links to expand all the text
It may well be in some part because of what you say. But I _think_ one of the points is to allow playing video with sound. Current popular browsers only allow websites to do this after a user-initiated action on the site, such as a click. I've seen cookie bars misused to trigger autoplaying videos in the past in this way.

See, e.g., https://developer.chrome.com/blog/autoplay#new_behaviors

lewiscollard··on Show HN: Material Files – Open Source Material Design File Manager for Android
> With Simple Mobile Tools being sold to an adware company

Well I missed this happening. I use the calendar, notes, music player (from F-Droid, so hopefully those versions will stay clean) and I loved them because they do exactly what they need to do.

Thank you for the heads up.

lewiscollard··on RIP Microsoft WordPad
From memory, WordPad's other advantage in Windows 95 days was that it could handle files larger than 64 kilobytes. Notepad could not; it would prompt you to open files in WordPad instead if you tried.

I always liked WordPad better than Word back then. It was faster and did all of the things I needed it to do. AbiWord occupied a similar sweet spot for me for some time after I went to Linux in the early 2000s.

lewiscollard··on Ask HN: Experience Starting a Blog
As Todd Snider once said, "I might share some of my opinions with you over the course of the evening. I'm not gonna share them with you 'cause I think they're smart, or 'cause I think you need to know 'em; I'm gonna share 'em with you because they rhyme.".

You don't need to worry about negative feedback if you don't have a comments section. I implemented my blog myself with Django, and the reason it doesn't have a comments section is because I didn't write it, because I am lazy. But a side-effect of that is that the minimal effort it takes to open up a mail client and write something to the email address in the footer tends to weed out the lowest-effort shitposts & flames.

As for me, I started one (link in bio, as the kids say these days) thinking that it might become a tech blog, because tech is what I do all week, and probably what I know most about. And then it actually became me mostly writing occasionally about my car projects, because that is what I love. Don't worry too much about staying on topic, is what I'm getting at. "Be yourself" is a silly cliche (arguably not really a meaningful concept, either), but like, be yourself; regardless of the topic I can always read someone who writes about the things they are really passionate for.

lewiscollard··on History of AMP and Why Everybody Is Against It?
I think there's some kind of automatic title re-writing happening on HN, which sticks a question mark on the end of titles that contain the word "why" and "is". I think the goal is to make titles less clickbaity. In practice, it mangles them such that they look like the author has a weak understanding of English punctuation and/or grammar :(
lewiscollard··on Make Linux look like Windows 95
My brain believes two things simultaneously:

* that Windows 95 was the first GUI I used for any extended period of time and that I will naturally think it's the best one for this reason, for the same reason people tend to think things they liked when they were teenagers peaked when they were teenagers; and

* that Windows 95 really did rule - to repurpose Hoare, "not only an improvement on its predecessors but also on nearly all its successors"

...and those two could fight each other all day.

Taking off the rose-tinted glasses, I might miss the UI, but I definitely don't miss how unstable it was. 25 years on I can still rattle off a Windows 95 product key off the top of my head as a consequence of reinstalling it so often.

lewiscollard··on In MySQL, use “utf8mb4” instead of “utf8” (2016)
In the WordPress world, it is the only database.[0] If you do WP, you do MySQL. You may sniff at WP (I certainly do), but it is used for 43% of all websites, which is not a trivial number of deployments, and not a small market.

I suspect it has a large market share in the "started as a trivial PHP program, grew to large application, too committed to MySQL to migrate to something else" market, too. There's that one website with the blue F logo that went this path, but there's probably thousands more.

That's not the same thing as anyone actually preferring it, but that's two possible reasons why there's an awful lot of MySQL deployments out there.

[0] https://codex.wordpress.org/Using_Alternative_Databases

lewiscollard··on Tell HN: GitHub no longer supporting unauthenticated `git://`
Shit, you're probably right. It only worked because I didn't tell SSH to only use the specified identity files (I threw it together in five minutes without really testing it, you can forgive me). Changing one of the lines to this (which it should have been all along):

    GIT_SSH_COMMAND="ssh -i $KEYFILE -o IdentitiesOnly=yes" git "$@"
...comes up with "Permission denied (publickey)". So, yep, you're 100% right.

Oh well. There's still HTTPS!

lewiscollard··on Tell HN: GitHub no longer supporting unauthenticated `git://`
> I just thought it might be a helpful PSA for people to keep in mind and maybe remember if something goes wrong

Oh, it was - I'm sure there's a lot of people who are being bitten by this, and nothing I said above should be seen as saying that your post was not useful. :)

lewiscollard··on Tell HN: GitHub no longer supporting unauthenticated `git://`
> So now when using plain git the choices are to have every action tracked, or to go through a very annoying process involving randomly generated keys.

EDIT: this alias has a bug that means it doesn't work as intended, see below, don't use it

If you're that worried, I threw this shitty Bash function together in five minutes just now; stick this in your bashrc and then `anongit ...` instead of `git`:

  anongit () {
    mkdir -p ~/.random-ssh-keys
    KEYNAME=$(openssl rand -hex 12)
    KEYFILE=~/.random-ssh-keys/$KEYNAME
    ssh-keygen -q -C $KEYNAME -N "" -f $KEYFILE
    GIT_SSH_COMMAND="ssh -i $KEYFILE" git "$@"
  }
Problem solved!

...or you could clone over HTTPS instead :)

lewiscollard··on Tell HN: GitHub no longer supporting unauthenticated `git://`
> Make using plain git more difficult

The change in question does not. It only requires that you clone over SSH or HTTPS, not over git://. I don't see why anyone would want to use the latter today.

Given how trivial it is to self-host your own Git repositories on any random Unix box, I am not worried about GitHub attempting lock-in even if they tried.

lewiscollard··on Simplicity of IRC
I dunno, I was there in the very early 2000s and as I remember it, for the subset of programmers I knew on IRC at the time, it was as Susam says: writing a shitty IRC bot - not a script, something from "scratch" that actually spoke the IRC protocol - was almost a rite of passage back then. From rose-tinted me-tinted glasses, I seem to remember that IRC-bot-related questions were a plurality of the questions asked in #vb on Dalnet back in the day!

You are also right to some extent as well; I wonder how much mIRC scripting has been underestimated as the gateway drug to programming for thousands.

(Rose-tinted/me-tinted disclaimer: the first non-trivial program I wrote was an IRC quote bot, in Visual Basic. I later rewrote it into Python, because I wanted to learn Python, which eventually led to my day job today...)

lewiscollard··on Please don't use Discord for FOSS projects
> And sorry for being so rude.

You freely chose to post the insult, so you are not.

> In 2021 everyone expects history and other things.

I should hope I am included in "everyone" and I do not expect that. I think IRC rules and I think chats are better when they are ephemeral. I know people disagree with me; that is the point of discussing it. It's strange (a cheap rhetorical trick, really) to point out the expectations of a group of people in the current year as if that was an inevitability and that is how things always shall be unto the ages.

lewiscollard··on Best practices for writing code comments
I agree with basically all of the article. But I have a probably-misguided idea for better comments: Change text editors so that they don't put comments in dark grey (which for most of us, is on a black background)!

Why does my text editor think that, e.g., a function call should be blue and keyword arguments to it should be bright orange, but a comment should blend in to the background? Have them be bright green or something! If something merits a comment, it should be the most visually important thing in that block. At least that'll make bad (pointless, redundant, or outdated) comments stand out enough to annoy people.

If anyone knows how to make Sublime Text do this I'll give them a big virtual hug. :)

lewiscollard··on Ask HN: Those making $500/month on side projects in 2021 – Show and tell
Yeah, I might have read the parent comment, thought "oh neat, good on ya", and not thought more of it if you hadn't pointed out that it's $29. Also it has open source software! Which runs on Linux! I had to order one just now for the funs and learnings.

Good job AussieWog93, and all the best to your business!

lewiscollard··on You click a link to a news site, to read an article that seems interesting
> I think they put an overlay on the page and intercept the first mouse event they can,

...such as one of those "totally-GDPR-compliant" accept-cookies-please modals maybe? :) I am 100% certain this is how a large number of sites bypass autoplay restrictions.

lewiscollard··on Use forums rather than Slack/Discord to support developer community
> This recurring discussion is very "This is the year for Linux on the desktop"

The only people I see unironically talking about "the year of the Linux desktop" are people that talk about _other people_ supposedly proclaiming the year of the Linux desktop. "This recurring discussion reminds me of a decades-old strawman/dead meme" is not a good way to introduce any straight-faced argument.

> Nobody wants to register on some random weird site, and figure that sites navigation, let alone their privacy/data policies. Discord/Reddit/Slack/etc... are easy to use.

Why do you speak of Discord and Slack as if they were eternal, and that we were all taught to use them as surely as we learned our ABCs and cut up our food? At one time Discord and Slack were that "random weird site", and I'll note that for vast numbers of people outside of nerd and tech communities they still are. As for me, given a choice (and outside of work I do have one), I'd touch neither because I find them both to be terrible software.

← PreviousPage 2 of 7Next →