Better HN
topnewbestaskshowjobs
Log inSign up

neillyons

586 karma · joined Oct 29, 2013 (13y ago) · 231 submissions

Software Engineer https://neillyons.io
Submissions

comment 1mo ago · link · parent

Just speculating, but I suspect Apple are releasing this because Jony Ive and OpenAI are working on something similar.

comment 1mo ago · link · parent

Elixir concurrency feels like magic with async_stream https://elixir.hexdocs.pm/Task.html#async_stream/5-options

  [
    "https://httpbin.org/delay/1",
    "https://httpbin.org/delay/2",
    "https://httpbin.org/delay/3"
  ]
  |> Task.async_stream(
    &Req.get!/1,
    max_concurrency: 3,
    ordered: true,
    timeout: to_timeout(second: 2)
  )
  |> Enum.to_list()

comment 2mo ago · link · parent

WhatsApp status could also work

comment 3mo ago · link · parent

I remember reading that in early versions of Python there was no built in True and False. Each user would implement this themselves as

True = 1

False = 0

then later these got added to the language. In Python 2 you could still reassign and swap them so that 'if False' was actually true!

True, False = False, True

Python 3 you could no longer reassign them.

comment 5mo ago · link · parent

Pronouns

comment 9mo ago · link · parent

I stopped my 1Password subscription last year and started using Apple Passwords. The user experience is great if you switch to Safari with fingerprint login.

comment 10mo ago · link · parent

My favourite is this disclaimer in the question. lol

> Is there any way to force install a pip python package ignoring all its dependencies that cannot be satisfied?

> (I don't care how "wrong" it is to do so, I just need to do it, any logic and reasoning aside...)

https://stackoverflow.com/questions/12759761/pip-force-insta...

comment 10mo ago · link · parent

When visiting Ayers Rock in Australia I stayed in Alice Springs. While I was there I learnt that Alice Springs exists because it was a repeater station for a telegraph line that stretched from Southern Australia all the way to London. There would be people listening to morse code, and tapping it out again to the next repeater station. Blew my mind that there was a wire that went all the way to London from Australia!

comment 11mo ago · link · parent

Can anyone recommend a native macOS app with a calendar like this that supports .ics calendars?

comment 11mo ago · link · parent

Bitcoin doesn't take into account that humans are forgetful.

If you forget your bank card pin code they would post you a new card and pin, if you phone them up. I've done this a couple times in the past pre-smartphone banks.

If you forget your bitcoin password you are never getting access back.

comment 12mo ago · link · parent

Does Elixir have any footguns like this? As it is immutable I don't think any of these are possible.

comment 1y ago · link · parent

If you imported from Safari/Chrome in the onboarding. Go to Settings -> Personalization -> Browser Memories.

It has summarized my browsing habits and interests. Very impressive.

- "The user has a routine of checking their Fastmail inbox daily around 08:27"

comment 1y ago · link · parent

Elixir via the Task module https://hexdocs.pm/elixir/Task.html

comment 1y ago · link · parent

I did a speed awareness course as I got caught speeding and was told if there are lamp posts the speed limit is 30mph unless stated otherwise.

comment 1y ago · link · parent

Crunchbang was such a good distro! I ran linux for about seven years. Ubuntu and then Crunchbang. Had my 2012 MacBook Pro dual boot into Crunchbang. Battery life was awful. It had no automatic fan control, so the laptop got so hot I could barely touch it. I ended up writing a bash script to manually control the fans using function keys https://gist.github.com/nwjlyons/b29ee6f7e26595f55a2a

As cool as it was, I can't be bothered with any of that these days. Just give me a Macbook Pro, as I know it will work and have amazing battery life!

comment 1y ago · link · parent

Golang will panic with a runtime error index out of range if you index out of bounds. There doesn't seem to be a nice built in way to do `arr.get(3)` like in Rust.

    slice := []int{1, 2, 3}
    i := slice[3]
    fmt.Println(i)

comment 1y ago · link · parent

Curious to know what people are building where you need to optimise like this? eg Struct Field Alignment https://goperf.dev/01-common-patterns/fields-alignment/#avoi...

comment 1y ago · link · parent

> really hard to cultivate a community of people who have a deep love for something, but for some reason can't see what is actually wrong with it that drives ppl away

Elm is another example

comment 1y ago · link · parent

wow.

comment 1y ago · link · parent

You still need to be careful, as this won't catch panics from go routines launched from your http handler.

comment 1y ago · link · parent

I looked at the Apple watch but choose Garmin as it has a physical button to start and stop my run. I don't know if this is still the case but with the Apple watch I think you have to tap the touch screen. Takes too long, especially when every second counts on a 400m lap round the track :-P

comment 1y ago · link · parent

Cognitive load example in Go. It is common to give variables single letter names. Now you have to build up a mapping in your head that for example `a` means `Auction`. You could skip this mapping if you just named the variable `auction`.

comment 1y ago · link · parent

Yep, Django's on_delete behaviour being implemented in Python instead of SQL has caught me out a few times over the years.

I often do `on_delete=models.DO_NOTHING, db_constraint=False` and add the on delete cascade constraint manually to the migration file. https://stackoverflow.com/a/78668897/288424

Same goes for `default. Prior to `db_default` I'd often edit the migration file and set the default in SQL.

I much prefer Elixir's Ecto now.

comment 2y ago · link · parent

Definitely "Code Red" for Google Search

comment 2y ago · link · parent

You can also get a Japanese Working Holiday Visa which allows you to work in Japan and stay for a year. https://yoyogi.io/en/how-to-get-a-japanese-working-holiday-v...

comment 2y ago · link · parent

I recently started learning Swift and Swift UI and was surprised at how complicated the language is. Especially regarding reactive instance variables. eg. @observableObject. Didn't understand it. There are like five different ways to do it. Ended up playing whack a mole until it worked.

comment 2y ago · link · parent

    get_in(x.a)
better example would be nested.

    get_in(x.a.b.c)

comment 2y ago · link · parent

Nice feature in this release is the addition of `get_in/1` which works with structs. eg. `get_in(struct.foo.bar)`

If `foo` returns `nil`, accessing `bar` won't raise.

comment 2y ago · link · parent

Here is the roadmap https://hexdocs.pm/elixir/main/gradual-set-theoretic-types.h...

The next milestone will include a mechanism for defining typed structs.

comment 2y ago · link · parent

Linked in the footer of that website is https://llili.li/. Even better!
12345
8