Weeknotes 88
5th March, 2023
“Hardcoded strings”
-
The Courtyard by Cabel Sasser
Whatever you’re working on right now, whatever it might be, I ask: try to leave a little space for a courtyard.
-
power_assert is interesting.
Power Assert shows each value of variables and method calls in the expression. It is useful for testing, providing which value wasn’t correct when the condition is not satisfied.
Failure: assert { 3.times.to_a.include?(3) } | | | | | false | [0, 1, 2] #<Enumerator: 3:times>
-
Host your own Mastodon server with Wildebeest from Cloudflare, I suppose.
-
I heard that Gandi, my domain registrar of choice have been bought by some less that great guys.
The TL;DR: if you have any trust or whatsoever in Gandi, you should seriously reconsider.
I decided to compile a list of alternatives for the TLDs I own.
Provider .co.uk .me .com .co Cloudflare $4.76 $12.55 $9.15 $22.00 Porkbun $5.96 $14.85 $9.73 $22.97 AWS $9.00 $25.00 $13.00 $25.00 DNSimple $10.00 $25.00 $14.50 $30.00 Gandi $11.36 $22.20 $19.87 $42.08 Clearly, Cloudflare come out on top in terms of price, but Porkbun are only very slightly more expensive and are called Porkbun.
The main thing I’ve learnt is that I’ve been overpaying for domain renewals. Get in touch if any have other decent options. I’m not moving anything just yet.
-
My experiment with using Arc is paying off. I really like it, although there was/is a learning curve. More or less every other browser I’ve used is tabs along the top, web page below. It’s been that way for a long time. Arc is not like that so breaking the muscle memory is hard.
Some thoughts:
-
Splits are really great – horizontal or vertical. If you have a tiling window manager (or something like one) you can achieve a similar result, but having it all inside Arc makes managing multiple windows easier.
-
Font rendering is not as nice as Safari.
-
Automatic Picture-in-Picture when watching YouTube is brilliant. When you navigate away from a playing YouTube video it will pop out to PiP automatically.
-
Copying the page URL with Shift + Cmd + c removes any tracking querystring 👌
-
-
Phoenix 1.7.0 released was released.
Verified Routes are more exciting to me than maybe they should be. I’ve never liked route helpers (and this applies to Rails too). I can’t remember what the function is called or what arguments it takes.
Perhaps I’m old school, but I want to see the URL, and helpers obfuscate my view of it. Instead constant running of
rake routes | fzf
is necessary (and slow) to figure out what I need.Verified Routes are the best of both worlds: hardcoded string URLs but with compile time checks so you don’t get them wrong.
Streams are cool and obviously a big deal too ;)
-
TIL about Ruby’s
Kernel#j
andKernel#jj
methods. (Via Haskrocket).Easily pretty print hashes are JSON.
I initially couldn’t get this working until I realised that you need to require “json” to make the methods available.
irb(main):001:0> require "json" => true irb(main):002:0> j({foo: "bar"}) {"foo":"bar"} => nil irb(main):003:0> jj({foo: "bar"}) { "foo": "bar" } => nil
-
TIL that PostgreSQL is named so because it was a successor to the Ingres database, so was post Ingres.
It was originally named POSTGRES, referring to its origins as a successor to the Ingres database developed at the University of California, Berkeley. In 1996, the project was renamed to PostgreSQL to reflect its support for SQL. After a review in 2007, the development team decided to keep the name PostgreSQL and the alias Postgres.