Recent submissions

Comment · 9 hours ago
Title needs (2016) appending
Comment · 1 month ago
I would say it's pretty common to talk to strangers on the train in England. I could just be the "Northerner terrifying Londoners by saying Hello" though. I do know not to start a conversation with a stranger on the tube.
Comment · 10 months ago
I always felt like go channels were more of a clever solution than a good one. Goroutines are a pleasure to work with though.
Comment · 1 year ago
Using document.addEventListener means it will work even if the DOM is updated without having to add new event listeners. If I'm not expecting the DOM to change I would be more inclined to do something like:

  document.querySelectorAll('.menu-wrapper')).forEach(menuWrapper => {
    const button = menuWrapper.querySelector('.menu-opener');
    const content = menuWrapper.querySelector('.menu-content');

    if (!content || !button) {
      return;
    }

    button.addEventListener(() => {
      button.setAttribute('aria-expanded', 'true');
      menu.showPopover();
    });

    content.addEventListener('toggle', e => {
      // reset back to aria-expanded=false on close
      if (e.newState == 'closed') {
        button.setAttribute('aria-expanded', 'false');
      }
    });
  });
The React example seems a little odd as well, if the "open" callback actually called "showPopover()" instead of only calling "setIsOpen" then the "useEffect" could be entirely redundant. The resulting code would be a lot clearer imo.
Comment · 1 year ago
I don't recall the exact numbers but I had a very similar experience, scoring very highly on spatial reasoning almost to the detriment of everything else.

I remember a close friend getting frustrated administering a working memory test on me. She couldn't believe how far removed from the norm my working memory capacity was given everything else she knew about me.

Comment · 1 year ago
I imagine the red blood was very noticeable on the white snow. I might be wrong though.
Comment · 2 years ago
I assume you're referring to Kowloon Walled City?
Comment · 2 years ago
I'm not sure that's entirely true in the UK. The Polish plumber taking British jobs is a fairly common trope in far-right discourse. I believe this is prevalent across Western Europe in general.
Comment · 2 years ago
You can also use anonymous functions if you find the module syntax a little terse or clunky for shell scripting.

    double = fn a -> add.(a, a) end
    double.(4)
It starts to look a bit like a weird untyped OCaml / F# if you use pattern matching:

    f = fn
      x, y when x > 0 -> x + y
      x, y -> x * y
    end
Comment · 3 years ago
Would Be Nice Ifs, maybe?
Comment · 3 years ago
It was already fairly popular in the UK prior to being acquired by Facebook.
Comment · 3 years ago
I live in a smaller city in the UK so my experience is likely much different from those living in larger cities.

I never wear a helmet when riding a bike and used to commute daily. I've never had an accident involving traffic and have come off my bike less than a handful of times commuting. It seems like the odds of me coming off my bike and hitting my head is very low.

I'm not averse to helmets I just don't think wearing one makes sense for my commute. I'd rather wear a woolen hat. I do wear a helmet when I go rock climbing and would probably wear one if I was commuting in London.

Comment · 3 years ago
curmudgeon
Comment · 3 years ago
> 2. Any advice about automatic whitespace/indentation handling with Emacs?

I use prettier-mode and editorconfig-mode. Everything is formatted on save so works well for me.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton