HNHacker News
TopNewBestAskShowJobs

janpot

2,170 karma · joined June 4, 2018

submissionscomments
janpot··on Create Slug from String in JavaScript
take a look at https://stackoverflow.com/a/37511463
janpot··on TRPC: End-to-end typesafe APIs made easy
Nice! I wrote something similar for Next.js a while ago. The pattern is so much more ergonomic than everything else I've used before.

https://npmjs.com/package/next-rpc

janpot··on A Silver Clasp
no cookie banner, no popups, no ads, no notification requests, no animations,... what a delightful reading experience this is on mobile
janpot··on Things you don't need JavaScript for
Next post: 5 Things you don't need GitHub actions for
janpot··on Google Tag Manager, the new anti-adblock weapon (2020)
> I want them to be able to see what doesn't work in terms of user experience.

That's not what they're doing, at all. They want to be able to see what doesn't work in terms of maximising profits. That may correlate with good user experience sometimes, but more often it results in the opposite.

janpot··on Bridge collapse in Pittsburgh’s Frick Park
Oh, I see. You meant "federal" government, I get it now (European here).
janpot··on Bridge collapse in Pittsburgh’s Frick Park
So weird to me these sort of statements. It doesn't need to have a 100% success rate, but if you don't even aim at having your democratic institutions cooperate, then what are they for exactly? And what do you propose as an alternative? private sector? As if they are not known for cutting every possible dollar they can on anything they do. At the expense of lives if they can get away with it.
janpot··on RegExr: Learn, Build and Test Regex
I sometimes use https://regexper.com/ to debug hard to understand regexes.
janpot··on Ask HN: Have you had Covid? How bad was it?
There will be a lot of survivorship bias in this thread.
janpot··on Next.js 12
It's being adopted in ts-node as well: https://github.com/TypeStrong/ts-node/blob/main/website/docs...
janpot··on Felicette – The Space Cat
We have a tuxedo cat that is named after her.
janpot··on Curiosity Is Better Than Being Smart?
> Is curiosity a desire to gain knowledge? Is it a desire to see if you are right or wrong? Is it a drive to test existing hypotheses? Is it a motivation sparked by novelty or uncertainty?

For me it's not just the desire to solve a problem, it's the desire to know whether I've solved it in the best possible way. This requires you to explore the problem space laterally.

janpot··on Facebook whistleblower says she wants to fix company, not harm it
My parents telling me as a kid not to start smoking definitely didn't prevent me from doing it later in life.
janpot··on Reasons to Quit Social Media
> I think part of the problem today with individuals trying to figure out how to moderate their social media usage is that it's not clear what specifically within social media constitutes harm.

I believe it's advertisement-driven content curation. You're being fooled into thinking that your feed follows your interest, but instead it optimizes around stealing your attention. The feeds control you, not the other way around.

janpot··on Username ending with MIME type format is not allowed
I was just using XSS as an analogy.
janpot··on Username ending with MIME type format is not allowed
Don't know the details of the vulnerability, but from the comfort of my armchair, it sounds like it's being patched in the wrong location. e.g. It's better to fix an XSS issue by escaping the input, rather than restricting the values it can take.
janpot··on Do not do in code what can be done in infrastructure (2017)
In practice, more often than not “X always happens” doesn't hold, there's always exceptions. Next thing you know, you're bringing your business logic into your infrastructure.
janpot··on Germany to Stop Free Covid-19 Tests in October
> vaccination does not prevent transmission

I keep hearing this but I don't understand where it comes from. IIUC, it doesn't matter that you're as contagious when sick and vaccinated as unvaccinated. When vaccinated you are less likely to contract the disease in the first place and therefore reduce overall transmission.

janpot··on NSO Group CEO says law-abiding citizens have 'nothing to be afraid of'
Which law should we abide by then? Didn't he sell his spyware all over the world?
janpot··on Jeff Bezos Is Not My Astronaut
If I had a choice, I prefer that these millions were spent in a way that's governed by the same democratic principles that ultimately enabled generating them.
janpot··on Facebook users said no to tracking, and now advertisers are panicking
Often I hear the argument, people saying "I prefer ads that are relevant for me over random ads". But the result of the tracking is not only that you get "relevant" ads, it's that your timelines and your feeds and your news gets tweaked in ways that makes you engage with ads as much as possible.

Not only do you get manipulated in buying stuff you didn't ask for (ads in general). You're also getting spoonfed content that tries to make you as vulnerable as possible to this manipulation. Up to a point that this is downright threatening democracy and our way of life.

I guess you could call this a form of censorship. Content gets suppressed, simply because it doesn't generate enough ad revenue. It's this type of censorship on "social" media that I consider much more harmful than the type that usually gets most of our attention.

janpot··on Installed electron / react, it has 1861 dependencies. This is a problem
What is it with modern frontend development that people think you can just quickly "get up-to-speed" with it? Nobody would accept these complaints of complexity had you said "I'm just trying to get these web developers up-to-speed hacking on the linux kernel", they would advise you to start them on something simpler, to get to learn the languages and tools gradually.

I agree there's more complexity than there should be, but you also dump them in the most complex stack that can be dreamed up in the field.

janpot··on Jeff Bezos’ Dystopian Legacy Goes Far Beyond Amazon
> decades of self-serving, power-hungry, and occasionally outright corrupt organizations that do not serve the interests of workers.

Are you talking about unions, or companies?

janpot··on Don't encode POST bodies like GitHub Copilot, use URLSearchParams
Sure, makes sense in this case, without any other extra functionality in the class. But there could be more functionality needed. It feels highly subjective to me.
janpot··on Don't encode POST bodies like GitHub Copilot, use URLSearchParams
Oh ok, I guess I could also do the following then

    class JsonBody extends Blob {
      constructor (obj) {
        super([JSON.stringify(obj)], { type : 'application/json' })
      }
    }
    
    fetch(url, { method: 'POST', body: new JsonBody({ hello: 'world' }) })
That's quite handy
janpot··on “The Martian” + Starship
Oxygen (2021)
janpot··on The pedantic checklist for changing your data model in a web application
With complex migrations, like spanning multiple tables or depending on external APIs, I sometimes use a variant of this. Where instead of migrating the underlying database in "Migration 2", my version 3 would migrate on read:

- Read from new representation

- If not found:

  - read X from old representation

  - migrate X to new representation (complex business logic here)

  - write migrated datum to new representation

  - return migrated datum
- Either wait long enough until all data has been read at least once or systematically call your API for all records you want migrate (depending on the logic, you might want to throttle this)
janpot··on Ask HN: Solo developer, what's your recipe to start working?
What works for me is picking a task that I estimate at about 10 to 15 minutes and just execute it. Even if it's just cleanup, or writing some docs, or polishing an API interface. If I haven't gained momentum after finishing this it means that today is not the day and I'll retry tomorrow. But usually it's enough to get me started and pick up more serious things.

10 to 15 minutes is short enough to not feel negative about having forced myself to do it, but long enough for me to "get in the mood"

janpot··on An interview with the man who keeps uploading my feet to WikiFeet
It's so refreshing how this article doesn't try to impose an opinion on me. It really engages me to think about the matter and form my own.
janpot··on Slonik: A PostgreSQL client with strict types, detailed logging, and assertions
Last few years I've been using a similar workflow with something like https://www.npmjs.com/package/pg-template-tag in combination with `pg`. I'm never going back to ORMs and query builders.
← PreviousPage 2 of 8Next →