Weeknotes 115
10th September, 2023
“Uncaught TypeError undefined is not a function”
-
I wasn’t entirely correct about being able to move the PiP window in macOS. It turns out that it’s the Arc PiP window which can be moved easily. The one Safari doesn’t allow it.
-
Zero side project progress. Not even Figma-ing.
-
How to autocomplete two-factor authentication codes with a single HTML attribute
If you manage an app that supports two-factor authentication, either through an app or SMS, you can make it easy for users to autocomplete their unique code. The trick is a single HTML attribute: [autocomplete=“one-time-code”].
Easy peasy.
There are many other values available to
autocomplete
worth checking out. -
I discovered a misspelt word in a codebase recently. There is a surprisingly amount of faff involved in fixing this in a Ruby on Rails project. In some programming environments this problem is a right click, rename, done.
-
The Primeagean reacted to nexxel’s article Why I Switched From Neovim To VSCode and I agree with all of his points. The trap of constantly tinkering config is a real problem and something I’ve fallen into. I need to focus on fixing real issues with my workflow rather than nice-to-haves. For example, I don’t use any kind of folding at the moment, and that would be a basic, and nice thing to have worked out.
-
So, I’ve been tinkering with my Neovim config…
I’ve added the which-key plugin which helps with remembering keymaps. I’ve found a lot of the friction in using new plugins comes from learning what the keymaps are. I think this will help.
Another improvement I’ve been wanting to make for ages (literally years) is easy access to a
rails console
. I usetmux
so it makes sense to open the REPL in a newtmux
split.I thought this was going to be really tricky for some reason, but Harry figured it out in no time. Whilst I was at it I added quick access to
rails routes | fzf
too in the same vein. -
What Happens to All the Stuff We Return?
It’s probably not a coincidence that the world’s two biggest retailers—Walmart, with revenues of five hundred and seventy-three billion dollars in 2022, and Amazon, with four hundred and sixty-nine billion—also offer some of the easiest returns.
Really interesting look into what happens with returns.
-
Mapping in 3D where the earth will become uninhabitable. Very cool visualisation of where we won’t be able to live one day. Good times.
-
Neovim tips are back, baby!
You can link a highlight group to another like this.
vim.api.nvim_set_hl(0, "NewGroup", { link = "ExistingGroup" })
For example, I wanted the
WhichKeyDesc
group to be the same colour as Strings in my code, so I did this.vim.api.nvim_set_hl(0, "WhichKeyDesc", { link = "String" })
If you want to browse all highlight groups and have Telescope you can use
:Telescope highlights
which lets you fuzzily search groups and shows them in the colours/style defined within the group. Neat.You can also see which highlight groups apply to the word under the cursor by issuing
:Inspect
. -
Support for running Rails system tests using Playwright was merged.
-
I enjoyed this commentary on David Guillot’s 2022 Djangocon.eu talk on htmx.
Server-side rendering, the one true way, seems to be gaining ground again and the Reacters are unhappy. You can see the push back in the comments of the stream against a “non-JavaScript” approach. They know no better.
I’m glad to see some people realising how far off the path we’ve gone.
-
Removing TypeScript - Prime Reacts.
From the comments:
DHH saying that Javascript is his second favorite programming language throws up major red flags. This guy is nuts.
-
I paid for YouTube Premium for the first time. I am unhappy with how much it costs, but it is very nice to not have any adverts. It’s a shame that that’s the only benefit for me personally. If I used YouTube Music it would be better value.