Weeknotes 109
30th July, 2023
“PAYG eSIM”
-
I’ve been watching Steven Soderbergh’s new sci-fi comedy series Command Z. Directly supporting something feels nice, and it’s thought provoking and well acted.
-
Weight loss update: It continues. The body works in mysterious ways insofar as eating little does not always correlate with loss, but eating Curry and Naan bread does. Staying straight and true in the face of that is the hard part.
I’ve been using a couple of apps:
-
Arc continues to improve. You can now Option click a link or tab and it will open in a vertical split which is something I want to do frequently, so that’s nice.
-
Garage – another S3-compatible object storage server.
An open-source distributed object storage service tailored for self-hosting
I’ve had brief success using MinIO for local development, so it’s nice to have options.
-
Do you like being angry and disappointed? I recommend the Private Eye podcast, Page 94.
-
Fancy building your own Redis with C/C++? Not right now, but one day.
-
“Getting weird results from GCP europe-west1”.
File under “How not to discontinue a service”. It seems InfluxData “discontinued” a.k.a. deleted a whole region and a lot of customers didn’t get a notification it was going to happen.
-
Edit MP3 tags (ask your parents) in the browser with mp3tag.js.
-
As you may remember I was considering getting a backup mobile network provider to help me stay online.
My phone supports multiple SIMs using eSIMs which means you don’t need multiple physical SIM cards. Unfortunately not many UK networks support eSIM, and if they do, not in Pay As You Go format (I don’t want to be tied into a monthly contract for a backup).
Fortunately, my friend Karl introduced me to Lyca Mobile, who piggyback on EE and offer PAYG with an eSIM.
The good:
-
It’s currently super cheap - 89p per month for 6 months. I mean, that is cheap.
-
The performance is anecdotally better than my current network, Three, in most places I have checked. Signal and download speeds are impressive.
The bad:
-
For reasons, I had to buy a physical SIM and then transfer my number (and bundle) over to the eSIM – it wasn’t clear how to do this, and an email to Lyca Mobile support took 10 days to respond.
Once I had a response it was easy to setup the eSIM on the iPhone - scan a QR code and away you go
-
The Lyca Mobile website is genuinely one of the worst I’ve ever used.
-
I’ve had some weird shit happen with random numbers texting and calling me. I guess the number’s are recycled on a regular basis whereas I’ve had my number for years. It feels scummy, and it probably is, but it’s 89p.
The interesting:
- The iOS network signal icon shows a split view for each network when you have more than one SIM (physical or eSIM) installed. It’s both cool and slightly confusing. I wonder how this copes with more than 2 networks?
I’m not sure what I’m going to do longer term, but I will trial these for a bit.
I really hope more networks start using eSIM and especially in combination with PAYG deals so that it’s easy to have multiple options. For example, I’d be keen to give Vodafone a go as I haven’t used them in years.
-
-
Flat White or Cortado? Lance Hedrick helps explain in CAFE DRINKS EXPLAINED. Basically you get what the barista fancies making you.
-
Building and operating a pretty big storage system called S3 – a really interesting talk on the scale that comes with building and operating Amazon S3.
Amazon S3 holds more than 280 trillion objects and averages over 100 million requests per second
🤯 Ok then…
-
Blockquotes in Screen Readers – How? Inconclusive.
-
Implementing Multiple Submit Buttons with LiveView – This is what I really love about Elixir. Pattern matching allows separate implementations for each action in a really readable way.
-
My latest side project is on-going but with slightly less progress this week. I need to remind myself that even though “weeks have passed” I haven’t been constantly working on it, so that’s not weeks of effort. And I’m finding my way with “best practices” in Elixir/Phoenix.
I have a situation where I enforce duplicate records at the database level with a unique index – good.
Ecto has two options for this dealing with constraints as far as I know 1) you can add a
unique_constraint/2
to your changeset and it will become an error which you can deal with manually; or 2) you can leave that out and it will be raised as an exception.In this case, you shouldn’t be able to perform this action through the UI, so it seems appropriate to let it raise and instead return the relevant HTTP status code.
The second option lets us catch the constraint error raised by Ecto (
Ecto.ConstraintError
) and raise a custom exception we have defined. We can then handle that exception as we like.def create_rating(user, attrs \\ %{}) do try do %Rating{user_id: user.id} |> Rating.changeset(attrs) |> Repo.insert() rescue Ecto.ConstraintError -> reraise Errors.DuplicateRatingError, __STACKTRACE__ end end
Using
reraise/2
means we don’t lose any stacktrace as we would withraise
.We can define a custom exception and tell it what HTTP status to return when this exception is raised within the plug pipeline.
defmodule Errors do defmodule DuplicateRatingError do defexception [:message, plug_status: 400] end end
Time and time again, Elixir and Phoenix provide a great solution.
-
Are you old or just cool? You might like Blur: Radio 2 In Concert.