HNHacker News
TopNewBestAskShowJobs

exogen

3,377 karma · joined March 7, 2007

JavaScript, Python, and general web hacker.

Web: https://brianbeck.com/

Mastodon: https://hachyderm.io/@exogen

submissionscomments
exogen··on So You've Decided to Move from Unity to Unreal Engine
hey Chris :) I'll email you!
exogen··on So You've Decided to Move from Unity to Unreal Engine
Would you be down to chat a little about your Blueprint experience and take a look at a tool I've been working on? Check my homepage (on my profile) for contact info if so, I'd be very thankful :)
exogen··on So You've Decided to Move from Unity to Unreal Engine
Hey, I've been working on something I think is pretty cool to address some of the shortcomings mentioned here. If you're up for chatting about your experience and offering some feedback, mind hitting my profile and shooting me an email (on my homepage)?
exogen··on PayPal “Buy Now” buttons have been broken for a week
In a similar vein, I swear only about 30% of Apple Pay buttons I encounter on the web actually work. The rest produce a little popup with spinner briefly and then disappear. It's incredibly frustrating.
exogen··on Was modern art a CIA psy-op? (2020)
If you like this kind of question, I highly recommend the Wind of Change podcast, about whether The Scorpions song of the same name was written by the CIA. Super entertaining!

https://crooked.com/podcast-series/wind-of-change/

exogen··on GitHub Incident
The "move fast" part was definitely sincere, to Microsoft's credit!
exogen··on GitHub Incident
I was just saying it's kind of ironic that pre-acquisition GitHub inspired confidence, and Microsoft-owned GitHub has been more "move fast and break things."

I also don't just mean outages like this... it's clear that Microsoft GitHub has been cramming a bunch of new stuff into the UI and not really treating it with care. I notice very amateur UI bugs, misalignment, bad spacing, overlapping elements, etc. all the time now. It was clear that old GitHub passed through a professional designer's eye quite carefully (or maybe just a developer with extreme attention to detail).

exogen··on macOS Cursors
I can't provide the reason, but I can add a story that might shed light on the answer.

Years ago I was hosting a movie night and we were watching a dark, stylish black & white film that required subtitles. This was either in iTunes or TV.app, whichever was Apple's flagship movie watching app at the time. Every time a subtitle appeared on the screen, the gamma (or something affecting brightness) would change ever so slightly, affecting the whole scene in a barely perceptible way. It drove me nuts. This wasn't some kind of adaptive dimming from the screen; I confirmed that the actual image (even when watching just on the laptop screen) was changing.

After some searching, a really wacky solution popped up: if you go into the Accessibility settings and bump up the size of the cursor ever so slightly, it'll fix it.

Supposedly, the reason was that macOS's cursor drawing is heavily optimized (potentially in the firmware?) and thus uses a different drawing path (maybe with GPU acceleration vs. without?) depending on whether the default cursor is being used or not. So, whatever drawing routine was used to render subtitles causing the gamma to shift was also triggered by having a different default cursor, making it the same whether or not subtitles were on the screen.

Even though I found a fix, to this today I'm still furious that Apple – supposedly known for their quality, attention to detail, and good multimedia experience – could overlook this in their flagship app. And now it's something I always do when setting up a new Mac: bump the cursor size.

exogen··on Ask HN: Something you’ve done your whole life that you realized is wrong?
OK here's a dumb one. You know how the label on EVERY toilet bowl cleaner bottle always says "Step 1: flush toilet"? I always dutifully followed those instructions, thinking "hmm, the extra splashing water must be pretty important and help it mix or something."

But no. One day I realized it's just that my toilet always started from a flushed state... like a normal person. But they knew somewhere out there, someone would try to clean their toilet still full of piss and shit.

exogen··on Accessible hamburger buttons without JavaScript
The latter would probably work, but the first is invalid HTML – you can't nest interactive elements. Will browsers allow it? Yes. But it's still invalid per the spec.
exogen··on React Wrap Balancer: Simple React component that makes titles more readable
And while the folks who are interested in web typography are here: here's another neat experimental demo: river detection in JavaScript: https://twitter.com/ua6oxa/status/1256734388072574976
exogen··on React Wrap Balancer: Simple React component that makes titles more readable
Hey, a topic I know something about! I've done something similar to this: "tightening" text to resist wrapping but not prevent it. I'll describe:

A subtle feature of OS X since its early days (but possibly not anymore) is that if you had something like a window title or a filename in Finder's column view, and you made the window or column smaller, before cutting off the text, OS X would shrink the letter spacing (and possibly other metrics) by a barely perceptible amount, so that the text could still fit. I always thought that was brilliant.

One day I was working on a very design-forward web project and wanted the same thing. Occasionally, text would wrap when it really only needed a few pixels of wiggle room to stay on one line. Thus, react-typesetting and a <TightenText> component were born: https://exogen.github.io/react-typesetting/

Eventually I realized it would be neat to make work with variable fonts (and their arbitrary axes) as well. Check out this demo: https://react-typesetting-alpha.surge.sh

I haven't touched or thought about this in a while, but I still think there's an interesting blog post to be made there about how it's done!

An interesting fact I learned about professional typesetting (and justification) is that, in order to justify lines, books don't just shrink the letter and word spacing: they also squish the characters themselves (in CSS this can be done with a scaleX transform). I guess my eyes have actually noticed this when reading books before, but I found it surprising because I always thought of the letterforms themselves as sacrosanct, and any distortion would be unacceptable. But it turns out, in almost every book you've ever read, 2–3% squishiness is perfectly acceptable.

exogen··on Pixelmator Pro gets a magical, AI‑powered Deband feature
FYI, they already do this by synthesizing film grain! https://waveletbeam.com/index.php/news/48-netflix-film-grain...
exogen··on Remix web framework aquired by Shopify
I suspect you are confused about what Remix is, unless I vastly misunderstand htmx.

By example, a request comes into my app's web server at `/posts/123`: how would htmx be involved at all in (1) understanding the request, and (2) generating the response? Remix isn't just client-side, it's also a server with routing and SSR.

exogen··on Ask HN: What game do you wish existed?
Yes, there’s only one active (non-bot) server but we play every night! “Discord PUB” is the server and it’s usually LakRabbit from around 4–6pm Pacific, then CTF for the rest of the night once enough people join up.
exogen··on Ask HN: What game do you wish existed?
In case the T2 fans here weren’t aware, it’s a free download now and people still play. There’s a Discord community and we do pickup games every month or so. You can get it here: https://www.playt2.com/
exogen··on Microwave ovens and their hazards
What's the latest science on microwaving plastic containers? Many now say "microwave safe" on them... did something change, like the research or the plastics used?

Many of my friends still refuse to do it, but I'm not sure if that's still well-founded. My thought process is: well, the lawyers let 'em explicitly print "safe" on there... so they must be pretty damn sure.

exogen··on Memory leaks are crippling my M1 MacBook Pro
Mine says March 27, 2017 and it does everything I've ever asked it to? Maybe you have different standards for what qualifies as ancient and crippled.
exogen··on Memory leaks are crippling my M1 MacBook Pro
> Why don't sed, awk, grep, etc.. all the Linux things work quite right? I need to add something else on macOS to get them to work like they did on Linux.

If you mean how they work, like command line arguments and such (and not just speed), that's because macOS is based on BSD and thus using the BSD and not GNU versions. That's not really a "not right" thing, it's just different, and would be the same if you used any other BSD like OpenBSD, FreeBSD, etc.

exogen··on “Does induced demand apply to bike lanes?” and other questions
Surely not every road or destination is going to have bike lanes, so isn't everyone going to have to mix with traffic eventually anyway? Having them in some places but not others is just confusing for everyone involved.
exogen··on “Does induced demand apply to bike lanes?” and other questions
Even as a cyclist, when I hear of new bike lane construction, my feelings on the matter are "meh" or even negative. I think we should instead just normalize cycling among the cars (mostly by educating drivers, who either get pissed or are too cautious to pass even when they have plenty of room). Bike lanes just create the mindset that bikes should be separate traffic, and screw you over as soon as you need to take a left (now you need to merge into the cars on your left instead of already being between them).

I rode my bike across the country and my favorite city for cycling is still Cleveland. Not a whole lot of bike lanes, but wide enough roads and flat terrain. And the only time I was ever struck by a vehicle was when I was riding in a bike lane (because they were trying to turn right).

exogen··on Wikidata or Scraping Wikipedia
I wouldn't say the data is better, just different. Instead of "how do I extract the info I want?" your problem becomes too much data to sift through. See my comment here: https://news.ycombinator.com/item?id=24992600
exogen··on Wikidata or Scraping Wikipedia
I missed the original HN and twitter threads referenced in the post, so I might just be repeating something that was already said there...

But, in nearly all cases I would trust a bespoke Wikipedia scraper over using the output of Wikidata or DBpedia. Not to disparage either project, because they're great ideas and good efforts. I have a firm grasp of RDF and SPARQL queries (used to work with them professionally), which also makes them tempting to use.

One issue is that Wikidata tends to only report facts whose subjects or objects themselves have articles (and thus Wikidata entities).

For example, compare the "Track listing" section of Carly Rae Jepsen's Curiosity EP on Wikipedia vs. the "track listing" property on Wikidata.

Wikipedia has:

    1. Call Me Maybe (link)
    2. Curiosity (link)
    3. Picture
    4. Talk to Me
    5. Just a Step Away
    6. Both Sides Now (link)
while Wikidata has:

    1. Call Me Maybe
    2. Curiosity
So not only has it ignored any tracks that aren't deserving of their own articles, but it also missed one that actually does have an article (track 6, a cover of "Both Sides, Now").

> Others asked about the data quality of Wikidata, and complained about the huge amount of bad data, duplicates, and the bad ontology in Wikidata (as if Wikipedia wouldn’t have these problems. I mean how do you figure out what a Wikipedia article is about? How do you get a list of all bridges or events from Wikipedia?)

Often the problem isn't that Wikipedia is wrong, it's that Wikidata's own parser (however it works) doesn't account for the many ways people format things on Wikipedia. With a bespoke parser, you can improve it over time as you encounter edge cases. With Wikidata, you can't really fix anything... the data is already extracted (right or wrong) and all the original context lost.

exogen··on The Button Cheat Sheet
The normal arrow (not the hand) is supposed to be the correct cursor for buttons, but many people change it to the hand because they think it indicates interactivity.

However, the div button is still wrong because it shows the text selection cursor in the button.

exogen··on Learn CSS
Sorry, my description of that one was a bit vague. The error I had in mind wasn't using `position: absolute` to anchor the button, but rather in not thinking about the offset parent.

As an example, if your goal is for the button to appear over the right-side inner box ("hero content") here:

    +-------------------------------------------+
    |+----------+  +---------------------------+|
    || nav      |  | hero                      ||
    ||          |  |                      (x)  ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    |+----------+  +---------------------------+|
    +-------------------------------------------+
...then you should make that button either a direct child of that hero content (and give that container `position: relative` to make it the offset parent), or if that's not semantically acceptable, then add a new container around the hero content which will match its size/position and serve as the button's offset parent.

Otherwise, if you just let the outer container be the offset parent because it happens to place the button in the same spot in the moment, then later when more content gets added to that container, you'll end up with this:

    +-------------------------------------------+
    |+----------+  +---------------------------+|
    || nav      |  | header                    ||
    ||          |  +----------------------(x)--+|
    ||          |  +---------------------------+|
    ||          |  | hero                      ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    ||          |  |                           ||
    |+----------+  +---------------------------+|
    +-------------------------------------------+

...where the button is no longer over the correct box, because it was never anchored to it correctly in the first place (instead, it was anchored to that outermost container).
exogen··on Learn CSS
I appreciate the semantics angle but I don't think it's actually related; semantics are a separate issue.

The reason the animation appears to work in the example you link to doesn't actually have anything to do with the form elements or semantics – rather, it's cheating by animating the `max-height` of the tab content from `0` to `100vh`.

This can be done just as easily without all the form stuff, but it's a bad solution to the accordion animation problem, because (1) it assumes that accordion content will never exceed the height of the viewport (what about on phones in landscape mode? you're only talking a few hundred pixels there), and (2) CSS will ease between the actual minimum and maximum values without regard for where the element's true height actually stops changing, i.e. it will animate from 0 to 100vh in the duration requested even if the height only ended up being like 20px and thus visually stops changing 5% of the way into the transition – so whatever duration and easing you specified isn't actually being rendered in the way that you wanted. If you specified an `ease-out` for example (starts fast, slows down at the end), you'd just get a super fast linear-looking transition that ends much quicker than you planned and never has the slow easing at the end (because CSS is actually still transitioning the `max-height` property which is no longer having any effect on your element that's much shorter than the max-height).

exogen··on Learn CSS
I'm well aware of details (I use it in GitHub READMEs frequently), but you still can't animate it like I described – without that, no designer is ever going to want you to actually use it. Builtin elements are worth fuck all if they don't meet your requirements!

You a moment ago:

> half the stuff things like React are used to do could be accomplished much better with a small amount of CSS

you now:

> yeah, you can't do it in pure CSS because you can't do most things in pure CSS

exogen··on Learn CSS
I wish you were right, but this is unfortunately wrong – and it's not because developers don't know CSS well enough, but rather that CSS is just plain not good enough. And ridiculous new features keep being added to it when we still don't even have some of the necessary primitives that should be there.

As an example, one of the most basic components I can think of is an accordion. You simply can't make one that works in a visually pleasing way (the way most people would expect!) in CSS because you can't animate to or from `height: auto`. The best you can do is some cop-out technique of fading out or squishing the content with `transform` and then having the content that follows it do an immediate jump up/down.

Instead, animating an accordion that actually animates the layout around it smoothly absolutely does require JavaScript, to tell CSS what non-auto values it needs to animate to and from.

And that's just the most basic component I can think of!

Another example: anchoring one element to another, when those elements don't have a parent-child relationship. Think tooltips. This requires JavaScript to measure the anchor element's position on every goddamn frame and keep the other one in sync, when the layout engine already has all the necessary information and could easily be built into CSS.

exogen··on Learn CSS
I've always wanted to write my own CSS guide, because (in my experience) people are rarely focused on the right thing when they're writing CSS.

Developers (especially junior) think that if it looks right, that it is right, and they're done. But CSS is not just specifying how something looks, you are also very much specifying visual behavior, not just appearance. Content is dynamic, layouts change at different breakpoints, new elements come and go, another dev comes in and adds something later... you need to account for all of these things.

For example, a developer rotated an element using CSS transform because the library we were using only supported a horizontal layout and not a vertical one. Sure, everything looked right in isolation, but now this element doesn't play nicely with others, because transform only affects the visual position, not the offset position of the element, so all its siblings still think it's horizontal, and they're getting all jumbled together.

Or, using absolute position to, say, anchor a close button to the top right of an element. Sure, the way you did it happened to put it visually in the right spot, but it's not actually in the right spot according to the layout engine because its offset parent is not the element you're trying to anchor it to, so if other content gets put in there eventually, it will be in the wrong spot.

Or, they'll use `line-height` to add space around some copy, without thinking about how that text will now look when wrapped.

So in my opinion, any CSS tutorial worth a damn needs to hammer home that (1) just because it looks right doesn't mean it is right, (2) you can't really ever style an element in isolation, you need to think about how it interacts with its parent and sibling elements, and (3) elements actually have two different positions, one that you see, and a potentially different one for layout.

Knowing those things is key to understanding whether you've designed things "correctly" vs. something that just happens to look right in the moment.

(I've only skimmed this course so far, so I'm not sure whether it satisfies what I want. But I'm hopeful!)

exogen··on Starting a TypeScript Project in 2021
AVA is great, I use it on a few projects and even developed a simple HTTP record/replay add-on for it. I'd say it's good for smaller projects.

One huge benefit of Jest though is the built-in mocking, including module mocking. This stuff is BYO in AVA. Module mocks in particular can be quite annoying to set up, so it's really nice that Jest pulls them all together in one cohesive package.

← PreviousPage 2 of 17Next →