HNHacker News
TopNewBestAskShowJobs

sswu

222 karma · joined July 14, 2016

submissionscomments
sswu··on React Renderer for Three.js
The TypeScript example does feel a little weird. I've used this library successfully with React + TypeScript with the following pattern:

  const mesh = useRef<THREE.Mesh>(null); // mesh has type RefObject<THREE.Mesh | null>
  ...
  useFrame((): void => {
    if (mesh.current != null) {
      mesh.current.rotation.x += 0.01;
    }
  });
  ...
  return <mesh ref={mesh} ... />

As others have mentioned, the ref will typically attach by the time a `useEffect` hook is called, but for safety it's nice to have the null check.
sswu··on Cabin releases 2nd-gen fleet of sleeper bus from SF to LA and back
I took this bus twice, and would happily take it again, but probably because it just happens to fill my niche. From Santa Monica, taking rideshare to/from LAX would easily cost an extra $30 each way, not to mention the traffic on Friday evenings. Sometimes it takes longer to get to the airport than the flight itself.

Cabin is nice because the total time I spend awake (< 30mins at each end) is less than that of taking a flight (at least a 3 hour contiguous block). It's also less stressful not having to worry about luggage, security, when to leave for the airport, etc.

If I couldn't sleep like a rock, or didn't live in Santa Monica, or wanted to go to south bay instead of SF, I would get a flight instead. I agree this is not for everyone, whether it be comfort-wise or location-wise, but I do hope this new tech helps people sleep more peacefully, and that they expand to more locations.

sswu··on The Raspberry Pi store is much cooler than an Apple Store
This post on the forums [0] is the best answer I've read yet.

They sell the Pi Zero (W) at such a low price to promote the platform for educational and non-commercial purposes. However, the margins are so low at that price that they cannot afford to sell in bulk. They apparently do offer bulk buys (>500 [1]) at higher prices.

The few options to buy multiple are to buy kits (which basically pass that bulk pricing in the form of overpriced accessories), or at a higher price (e.g. I see $22 on Amazon), or be very patient and keep ordering.

[0] https://www.raspberrypi.org/forums/viewtopic.php?t=198705#p1... [1] https://www.raspberrypi.org/forums/viewtopic.php?t=201916#p1...

sswu··on I have chosen the wrong flight dates because your date picker is broken
I ran into a similar issue applying for Global Entry. Luckily an appointment at 3am on Saturday suggested the times were in UTC. Nevertheless this was unnecessary uncertainty and anxiety - what about those who aren't familiar with UTC time?

How can we design datetime libraries to prevent these issues? Or at least make it so that error-prone behaviors must be very explicit?