Hacker News new | past | comments | ask | show | jobs | submit | abrioy's comments login

I have a similar setup at home with an M5Paper[1] to display a daily screenshot of my homeassistant dashboard. It's a neat little device based on an ESP32 chip with an e-ink display and some sensors.

I never thought about using a Kindle, even though I have an old jailbroken Paperwhite... It fits so much better for this usage, and would certainly have saved me days of working around hardware limitation.

[1]: https://shop.m5stack.com/products/m5paper-esp32-development-...


I have thought about doing a similar setup for an in-home dashboard with HA and possible some other widgets, but would really like a larger option. Even a Kindle DX would be better, but getting one of those is still several hundred aud. Are there larger consumer-accessible e-ink displays, or is that kinda it?


In Firefox, holding shift while right clicking works most of the time. It display the default context menu regardless of the website.

For ins.tance you can shift right click a video to use picture in picture on Youtube


You can use a type guard[1] as an argument to Array.filter, but the function has to be explicitly typed as such.

I don't know why the type isn't narrowed in Array.filter like it is in if statements without this weird workaround.

  const array: (number | string)[] = [];
  
  const mixedArray = array.filter(value => typeof value === 'string');
  // mixedArray: (number | string)[]
  const arrayOfString = array.filter((value): value is string => typeof value === 'string');
  // arrayOfString: string[]
This example in Typescript playground: https://www.typescriptlang.org/play?#code/MYewdgzgLgBAhgJwXA...

[1]: https://www.typescriptlang.org/docs/handbook/advanced-types....


Oh so there is an overload!

filter<U extends T>(pred: (a: T) => a is U): U[];

Additionally, getting TS better at inferring type guards is an open issue (literally): https://github.com/microsoft/TypeScript/issues/38390


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: