franey

Joined 10 years ago

Karma
127
Submissions
64
Member since
Feb 29
https://johnfraney.ca
View on Hacker News

Recent submissions

Comment · 25 days ago
I'm still having trouble pushing to my repo although the issue. is marked as resolved. Maybe the fix needs some time to seep through various servers.

Edit: 4 minutes later and I can push again

Comment · 1 month ago
That's an interesting idea. I might get hung up for cases where "previous" is a different type from "current", like if you're reducing a list of objects into a single object. You've got the current item of the array and the current state of the accumulator, so they're kind of both current. Or you've got the last state and current item, but "last" is ambiguous.

In general, I find that if something is hard to describe in plain language, it's hard to code. Reducers are a bit clunky to talk about, which could make them harder to reason about, too.

Comment · 1 month ago
At least in TypeScript, it's a bit clunky to type, and I usually forget the order of the reduce function's arguments (accumulator, current item). Maybe it's just me, but it's especially easy to forget the order when the position of the accumulator is the 1st argument to the callback but the 2nd argument of the reduce function:

    array.reduce(
      (accumulator, currentItem) => {...},
      initialValue,
    )
In .filter(), The current item is the 1st argument and the intermediate/accumulated value comes later: filter((currentItem, index, intermediateArray)) => ...)

I use .filter() more often, so that argument ordering where currentItem is right next to the array is more intuitive for me

Comment · 10 months ago
It looks to me like the big benefit is being able to use just one hand for this. I'd be more likely to use the watch, too, but this would be great for people with one arm, for example.
Comment · 1 year ago
For anyone looking to use this, I recommend using this CSS before the closing body tag. It disables the fade effect for visitors who prefer reduced motion, and the old page fades out while the new one fades in. (I've got an optional rule that keeps my header in place while the rest of the content fades out/in)

  @media (prefers-reduced-motion: no-preference) {
    body > header {
      view-transition-name: header;
    }

    @view-transition {
      navigation: auto;
    }

    ::view-transition-old(root) {
      animation: fade-out 0.3s ease;
    }
    ::view-transition-new(root) {
      animation: fade-in 0.3s ease;
    }

    @keyframes fade-in {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    @keyframes fade-out {
      from { opacity: 1; }
      to { opacity: 0; }
    }
  }
Comment · 1 year ago
I had a Pebble Time Round, too, and it was great. For me the Pebble hit a sweet spot for a smart-enough watch that allowed me to keep my phone in my pocket. I could get notifications and reply to them right from the watch. I have a Withings SteelHR now, and it's great as a watch + activity tracker, but not being able to dictate replies to the notifications I get means I reach for my phone more now than I did with my Pebble
Comment · 2 years ago
This post might have some hot takes and I'm no expert, but over the past decade I've found these rules of thumb to be helpful when reviewing and writing user stories.

If you have some other tips, I'd be happy to hear them!

Comment · 3 years ago
It is something that distinguishes them, certainly. As someone who switched from using Vue to React at my day job, dev tooling & editor support have been the things that stand out the most to me. React works well with Vite, which has helped make it easier to use, and I've been migrating projects away from Webpack + Jest to Vite + Vitest, which saves a lot of dependency maintenance. I definitely miss Vue 3's VS Code extension when I work in React, though.
Comment · 3 years ago
https://johnfraney.ca/blog/

Generally I'll write a post when I try to do something that's difficult to find an example of online. I don't get a _ton_ of traffic, but writing prose is a nice change from writing code.

Comment · 3 years ago
We're getting pretty off topic, but it wasn't what they were protesting that was illegal, it was how they did it. For a US comparison, First Amendment rights don't include a right to occupy city streets for weeks, even if you're doing it to protest the government.
Comment · 3 years ago
It wasn't, no. It was meant to clarify for other readers that people didn't have their bank accounts frozen for protesting COVID; they had their bank accounts frozen for financially supporting or participating in an illegal occupation of a city centre.

Your point stands that governments/courts decide what is illegal and that they have the power to freeze bank accounts when those accounts are used to fund illegal activities.

Comment · 3 years ago
Comment · 5 years ago
You bet. I've played around with AVIFS and it can autoplay and loop. I made gif2avif.com for fun, but I can't promise that it will work well.
Comment · 6 years ago
That was a great MVP plan for that feature! Figuring out what not to build is a great way to save development time.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton