HNHacker News
TopNewBestAskShowJobs

ht85

1,098 karma · joined May 17, 2016

submissionscomments
ht85··on Recall for Linux
I was thinking about switching back to Windows but finally getting missing functionalities like Recall may change my mind...
ht85··on Build a minimal decorator with Ruby in 30 minutes

    (maximum_number_of_students <=> students.size).clamp(0..)
Holy... Is this better or worse than write-once perl regexes?
ht85··on Tesla Cybertruck deliveries on hold as trims are flying off 'bulletproof' truck
All that's left is to make it road-proof!
ht85··on How to lose a fortune with one bad click
The wallet name was exodus, how fitting :D
ht85··on If not React, then what?
Another thing is that almost every complaint I see about React (except bundle size maybe, but who cares?) exists in the APP context.

If your use case is a simple website, React is just a nice templating lib and you won't need to use any of the things people generally dislike about it. That AND your experience when you inevitably have to add some interactivity is going to be 100x better than vanilla JS.

As for the build step, there are many turn key solutions nowadays that "just work". And isn't a small build step a plus, compared to being at the mercy of a typo breaking everything? To me that piece of mind if worth a lot, compared to whatever manual testing you'd have to do if you work with "text" files.

ht85··on Civet: A Superset of TypeScript
It looks like rubyist brainrot
ht85··on Breaking Down OnlyFans' Economics
There is a reason why many parts of the world will ticket you for not wearing your seatbelt. There is a reason you cannot (could not? crypto changed a lot) do advanced stock trading without a license. Why gambling is regulated, etc.

We don't want people to hurt themselves, because we have humanity and because they become a drain on society.

I find it hard to be that black and white with phenomenons like OF, that emerge from a mix of societal and technological advancement.

There are grey zones and not everyone is fortunate enough to be taught to be responsible. Not everyone can go through life without feeling desperate and resort to doing things they would not be proud of.

We should try to educate and protect people instead of pointing internet fingers at them.

ht85··on Breaking Down OnlyFans' Economics
> I am lacking empathy for those who are apparently so hooked up to the here-and-now

A large amount of those people are very young, at an age where you don't really pick your options solely on their super long term consequences.

Most people are going to be "stupid" in their early adulthood, failing and adjusting is a big part of it. Unfortunately, some of those decisions will stick more than others and sex work is very sticky (zing).

ht85··on Creating a Git Commit: The Hard Way
You can also discard changes that way, e.g.:

    git checkout -p -- .
ht85··on Mastering Ruby Code Navigation: Ruby LSP Enhancements in the First Half of 2024
Strongly typed languages have a higher barrier of entry and require an engineering mindset. That's anecdotal but if I think of exceptionally competent people I've worked with on JS projects, all of them have spent time building and advocated for properly typed code bases.

The other camp "just hates it" because it "slows them down", as it seems they spend most of their time fighting the types but never get to the point where you get that huge return on investment.

ht85··on Ask HN: Tell me your stories of taking lower paid work to be happier
I have a small software company, under 10 employees. We make B2B applications and focus 100% of our efforts on understanding our customers' needs and the quality of our product. No marketing, no "incentives", nothing. Just honest work and creativity.

I've done consulting here and there and going full time could easily clear half a mil a year. I make a LOT less than that.

Our customers are happy. They are warm and praise us. They are forgiving when we make mistakes because the trust is high. They tell us about all the trickery they face from most other companies all the time.

It is a true win win. I do not sleep on a pile of cash but I sleep very well nonetheless.

ht85··on React 19 Breaks Async Composability
It is exactly that. We make stuff, problems arise, we make new stuff that does not suffer from said problems.

Because everything is a trade-off, new stuff creates new problems. Those are the problems complainers complain about, ignorant of their history.

The cycle then repeats.

Maybe I am not cynical enough but doing easy things from the past is completely trivial and doing unimaginable things from the past is not that hard anymore. Looks like the cycle has some forward momentum in the end!

ht85··on Show HN: Markdown HN profiles at {user}.at.hn
Does your curvy monitor support touch?
ht85··on DOJ: Man sentenced to 14 years for posession of deepfake CSAM
> VR? Sex dolls?

Until now, VR child porn and child sized sex dolls were not on my mind when I thought of state sponsored healthcare.

I say this half jokingly, I am not really sure how I would want society to deal with that kind of mental illness. It's hard to have a nuanced perception of it, yet without nuance we are no better than the people we judge...

ht85··on What to do when an airline website doesn't accept your legal name
It says there are 6 people with my last name in Spain, guess you can call it uncommon :p
ht85··on What to do when an airline website doesn't accept your legal name
No, names needed to match my ID document, which only has first name and last name.
ht85··on What to do when an airline website doesn't accept your legal name
No middle name, just first name last name.
ht85··on What to do when an airline website doesn't accept your legal name
I once tried to open a bank account in Spain, which could not be done because I did not have a second last name. Spanish babies receive the last names of both parents.

The employee was trying her best and I eventually suggested she could put my last name twice. She made a face for an instant then said she was not allowed to do that.

I later understood that the face was because having two identical last names suggests inbreeding or incest... I am sure there are plenty of jokes about that in Spanish culture. lol.

I never managed to open the account and in the end had to go to a different bank.

ht85··on U.S. is said to open criminal inquiry into Boeing
> honestly point to an example

No but I can come up with a KPI that does.

ht85··on Adding type safety to object IDs in TypeScript

    function is<T extends string>(value: string, prefix: T): value is `${typeof prefix}_${string}` {
      return value.startsWith(`${prefix}_`)
    }

You can now do `is(id, 'user')`.

If you do that often you probably want to create separate functions, e.g.:

    function isFactory<T extends string>(prefix: T) {
      return (value: string) => is(value, prefix)
    }

    const isUser = isFactory('user')
    const isOrder = isFactory('order')
Not too bad.
ht85··on Shouldn't FROM come before SELECT in SQL? (2011)
If you ever need column name autocomplete, writing an UPDATE statement and changing it after is an ok workaround.

It would probably be a tough change to push through for the standard committee... a great one for users though, even if it takes 10+ years until you can use it in production.

ht85··on Password may not contain: select, insert, update, delete, drop
Make it 3 times, you never know how clever those hackers folks could be!
ht85··on Why does holding a key fob to your head increase its range?
You are correct, wikifeet confirms it.
ht85··on Why does holding a key fob to your head increase its range?
From the top answer:

> 1/2 m ≈ 1.5 ft

Thanks US units for the quote of the day: "Meters are for waves, feet are for antennas"

ht85··on Boeing wants FAA to exempt MAX 7 from safety rules to get it in the air
The McDonald-Douglas Fast Engineering company. I'm flyin' it!
ht85··on 'everything' blocks devs from removing their own NPM packages
Just tried installing it, fails as some of the dependencies have been made private :(
ht85··on 4B If Statements
A better design would look like this:

    CREATE TABLE numbers (
      minus_four_billions_two_hundred_ninety_four_millions_nine_hundred_sixty_seven_thousands_two_hundred_ninety_six_is_even BOOLEAN,
      ...
      zero_is_even BOOLEAN,
      one_is_even BOOLEAN,
      two_is_even BOOLEAN,
      ...
      four_billions_two_hundred_ninety_four_millions_nine_hundred_sixty_seven_thousands_two_hundred_ninety_six_is_even BOOLEAN
    )
That design can store multiple versions of the data, making it more resilient to future changes in the even/odd property of numbers.
ht85··on "Useless Ruby sugar": Endless (one-line) methods
I completely agree, I hate that way of coding and would go for the concise version.
ht85··on "Useless Ruby sugar": Endless (one-line) methods
If only functions could take arguments...

Doesn't that already look 100x better?

    class UserCreator
      def create_user(email)
        user = create_user_object(email)
        assign_admin_role(user)
        assign_invite_permission(user)
        call_invite_template(user)
      end
      
      private
      
      def create_user_object(email)
        User.create(email)
      end
      
      def assign_admin_role(user)
        user.roles << find_admin_role
      end
      
      def assign_invite_permission(user)
        user.permissions << find_invite_permission
      end
      
      def call_invite_template(user)
        find_invite_template.call(user: user)
      end
      
      def find_admin_role
        Roles.find_by(name: 'admin')
      end
      
      def find_invite_permission
        Permissions.find_by(name: 'invite')
      end
      
      def find_invite_template
        Templates.find_by(name: 'invite')
      end
    end
ht85··on "Useless Ruby sugar": Endless (one-line) methods
I call it "assembly ruby", where registers start with "@" and opcodes are defined with "def".

So dreadful.

Page 1 of 12Next →