HNHacker News
TopNewBestAskShowJobs

bfred_it

449 karma · joined May 27, 2014

submissionscomments
bfred_it··on Why did a hedge fund manager worth $700M take a $630k job managing an oil fund?
I think it’s less about being able to spend the money (of course you can) than needing to spend it.

Do you really need a 100-million yacht and a 20-bedroom villa? No.

bfred_it··on The creeping scourge of tooling config files in project root directories
There’s a solution to this problem: https://github.com/sindresorhus/hide-files-on-github

Additionally, your OS probably already natively hides files that start with a dot, so this is just a UI problem.

Please don’t “solve” this issue by moving files to a sub-directory. If anything, only leave non-config files there, it’s the obvious simple solution that most projects follow anyway.

bfred_it··on Make your 404s into 302s
I recently dropped my last shared hosting in favor of Vercel/Netlify and some content was lost. This solution wouldn’t work for me because the very reason why the content was lost is that I don’t want to pay for hosting I barely use.

A better solution would be an intermediary part that never changes — say, CloudFlare — that caches HTML pages forever, automatically adds a “Archived content” header to the page, and warns the author so that they can either allow the archived version or make it a 404/410 instead.

Nobody wants to maintain servers forever, but serving static/frozen pages is much easier and cheaper.

bfred_it··on Bootstrap v5: drop Internet Explorer support
Disability isn’t a choice
bfred_it··on Firefox 75: Ambitions for April
WordPress does this by default and that’s the most common platform to date. I’d dare to say that most websites have those attributes, but most SPAs don’t, because that’s too hard.
bfred_it··on Firefox 75: Ambitions for April
The attributes are overridden by CSS. You should have:

    max-width: 100%;
    height: auto;
What the other user is talking about is a new feature that FINALLY uses the attributes to preserve the ratio before the image starts loading.

Kinda ridiculous that we had to wait 8 years of “responsive design” before they realized that this was always supposed to happen.

bfred_it··on How to manage HTML DOM with vanilla JavaScript only?
I hope you don't use that since it randomly returns either an element or a list of elements, so you'd have to also add an if/else every time you use it.

This is my go-to:

    const $ = document.querySelector.bind(document);
    const $$ = document.querySelectorAll.bind(document);
Tip: browser consoles already have these shortcuts, except $$ returns an actual array there instead of a NodeList.
bfred_it··on How to manage HTML DOM with vanilla JavaScript only?
It's up to you to chose reasonable modules by reasonable developers. Notice I didn't call it a library, it's a 1kb module that has the code from the example + fixes you'd want anyway.
bfred_it··on How to manage HTML DOM with vanilla JavaScript only?
I would never recommend copy-pasting this code into your project:

https://htmldom.dev/copy-text-to-the-clipboard

I get "trying to stay vanilla", but any reasonably-common snippet should either be installed from npm or published there.

For this specific issue there's a module named almost exactly the same and it restores the previous selection and focus as well: https://github.com/sindresorhus/copy-text-to-clipboard/blob/...

This is the point of published modules: your code isn't stuck into the version someone wrote in 10 minutes 5 years ago.

bfred_it··on GitHub satanically messing with Markdown – changes 666 to DCLXVI
Which link are you more likely to click on?

- GitHub satanically messing with Markdown - changes 666 to DCLXVI

- GitHub changes numbers to Roman numerals in lists

I’d call it functional clickbait.

bfred_it··on Pika – A JavaScript package registry for the modern web
With GitHub templates and npm’s init/create packages you already have options without having to use an editor.

Examples:

    npm init esm
    npm init react-app
https://docs.npmjs.com/cli/init
bfred_it··on Suspect can’t be compelled to reveal “64-character” password, court rules
That’s why you should put a pass phrase on it. Firefox syncs my passwords but has to ask for my master password at launch. Same goes for Google Chrome’s passwords: they’re encrypted at rest and can’t be displayed online for that reason, you have to sync with Chrome.
bfred_it··on Run an Internet Speed Test from the Command Line
For those who are more familiar with npm, there are two packages for this by Sindre Sorhus. You can run them without preinstalling them with npx, if you wish:

    npx speed-test
    npx fast-cli
The second one uses fast.com
bfred_it··on Netlify Analytics
This is the same exact comment I see on most HN posts about services.

Probably most people’s time in maintenance and development is worth more than $9/month, that’s why these services exist.

Semi-related xkcd https://xkcd.com/1319/

bfred_it··on A horrifying globalThis polyfill in JavaScript
eval doesn’t work with some CSP settings, the article mentions this and other limits of previous solutions.
bfred_it··on Malicious remote code execution backdoor discovered bootstrap-sass Ruby gem
> This doesn't scale easily when you consider the volume that places like NPM have.

Found the blanket statement for npm.

How about instead of reviewing 1 library of 10k lines that does everything, you review 10 focused modules for a total of 1k lines?

Also modules like left-pad don’t change that often so you probably have to review only changes in the top modules.

We need to stop this mentality that dependency count should be low. Look at total LOC and you’ll probably find that it’s not as bad as people like to paint it.

bfred_it··on Volvo is introducing a 112mph speed limiter to all its new cars
What percentage of the population speeds vs what percentage has track days?

Surely those who have track days can disable the limit or buy a car without it, while the vast majority of "casual speeders" won't be affected by it.

Even 112 is quite high compared to the speed limit in most of the world. 100 would be right, outside Germany.

bfred_it··on Facebook won’t let you opt out of its phone number ‘look up’ setting
We had a million years to grow up, I don't think we'll ever get there (without drastic measures a la 1984, if you wish)
bfred_it··on This Cat Does Not Exist
ML generates some rather bad artifacts. Just look for those.

Even in this[1] difficult comparison you can see the non-human repeating skin patterns on the right and the awkward teeth contour. Also hair-on-skin often looks wet and with unnatural bends.

When comparing wrinkly people then it gets a little harder.

1: https://i.imgur.com/KWnhkBS.jpg

bfred_it··on Oh God, It's Raining Newsletters
Give up. There’s too much content, you obviously can’t handle it all.

Just acknowledge this and just enjoy what you can.

A few years ago I thought I could get through my to-read list, then I realized I couldn’t and stopped worrying about it.

bfred_it··on Uber’s transit offering just went live in Denver
I recently flushed years of Google history but I kept the tracking enabled. I’ll keep flushing it regularly and you could do the same.

I don’t really care that they track me for a short time, it’s not like they don’t keep logs anyway.

bfred_it··on Taxpayers Should Never Subsidize Stadiums
Games are not just about a ball moving. People attach feelings to players and teams, especially if they’re from their city.

A computer match wouldn’t have either

bfred_it··on Windows Sandbox
Isn’t macOS doing that? The Mac App Store only allows sandboxed apps and macOS allows almost only apps from the store to be installed (+ certified developers) unless you change the system's settings.
bfred_it··on Pixel 3 call quality issues
I call about 2 hours a week and still manage to use my phone more than 20 hours a week. Is calling still the primary function of my "phone"?

We just call it phone because that's what we attached a computer to, but it's more like a pocket computer with LTE modem for most people. I'd call it Pocket PC if I could!

bfred_it··on Locking in WebKit (2016)
Nitpick: They don't "use WebKit" but Safari itself. They can only offer "web views" (which are always just Safari)

Edit: maybe this isn't entirely correct, Apple calls them WebKit APIs in their docs. Only the latest view is actually called `SFSafariViewController`

bfred_it··on What happens when packages go bad?
That's one way to bloat your repo.

There's no reason to commit your dependencies if your intent is security. Just use the lock file. The packages won't change on npm and you'll always get the same version for all sub-dependencies.

bfred_it··on What happens when packages go bad?
npm handles sub-dependencies with ease so people aren't afraid to pull in smaller dependencies.

Also since the code has to be downloaded (or uploaded to small lambdas, for example), JS developers are generally weary of depending on large libraries.

bfred_it··on Proof That iOS Still Hasn’t Gotten Undo Right
"Delete all of my alarms"

I have to say this regularly to clean up the list. There's no other way to do this at once.

bfred_it··on In the Works – AWS Region in Milan, Italy
Most Italian words pretty much match their IPA representation, minus the pretty regular exceptions like Q, C, G, Z and H and the rare irregularity.

It may be difficult to an anglophone, but I'd argue that the phonetic irregularities of English are much more of a problem to a learner. "though/tough/through" never happens in Italian.

bfred_it··on Apple's New Map
That's a good way to see it, but the copy-paste comparison is bad. Copy-paste is so low-level that I can do everything with it, without the iOS having to wait years to get the functionality (if ever)

e.g. I want to translate a message. Either I wait for every messenger/OS to get a decent in-app translator, or I use copy-paste into Google Translate — very clunky, but better than not being able to.

Page 1 of 6Next →