Hacker Newsnew | past | comments | ask | show | jobs | submit | sandrot's commentslogin


Very cool!


thank you. I had to change my idle connection timeouts. Eeep!


You're right, thank you for the explanation. My REPL runs the code in the textarea in an anonymous Async function, which is why top level async works in my examples.


Try using Array.from(arrayish).forEach() to convert the thing that looks like an array to an actual array. For instance, you can't use map() on a NodeList (document.querySelectorAll returns a NodeList), so you have to use Array.from(NodeList) to first convert it to an array.


> Try using Array.from(arrayish).forEach() to convert the thing that looks like an array to an actual array.

Spread syntax is my goto for that:

  [...arrayish].forEach(...)
But, it being JavaScript, there’s probably a subtle distinction in where Array.from(arrayish) works and where [...arrayish] works.


There's a very big distinction.

`...foo` requires `foo` to be an iterable (implements the iterator known symbol).

`Array.From()` only requires it to be array-like and not necessarily iterable.


Good point. I don't think I've run into many non-iterable arraylikes, but I understand they used to be more common (e.g., a number of standard things that are now specced as iterable arraylikes used to be just the latter) and there’s probably a lot lurking in library/legacy code.


Thank you, Mark! Super long time.


Hi all, I’m working on an app to help find and delete duplicate or near duplicate photos. I’m building it for my dad to help him consolidate all of the redundant family photos he collects, and I’m trying to do it quickly before he completely runs out of space on iCloud. I hope it’s useful.

It’s been a lot of fun to develop, and finally gave me a chance to try out Mithril.js which is a pretty sweet piece of minimalist software.


- My first Godot game, which isn‘t downloadable yet but lots of fun to work on. https://sandrot.itch.io/starboard

- Sound Bath iOS app for ambient relaxing sounds. https://apps.apple.com/us/app/id1534808677

- Bread Book iOS app for saving recipes that use baker percentages. https://apps.apple.com/us/app/bread-book/id1519534917

- capybara-chrome is a Capybara driver for headless Chrome using the remote debugging protocol. Works pretty well but could use some TLC. https://github.com/sandro/capybara-chrome

- Rewriting my website using a 2 file architecture: 1) Go (web) executable and 2) SQLite db. All html pages and assets are stored in the database. https://turriate.com/articles/my-own-static-site-generator


Mataya, thanks for mentioning M1. I haven't heard of it before. What's your referral code?


You're welcome! https://mbsy.co/lHSCs


just going to leave this here: http://stopwritingramblingcommitmessages.com


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

Search: