Weeknotes 55
17th July, 2022
“Leaking”
-
Water leak. Bathroom partially destroyed during investigation. Gas leak. Heating engineer can’t find leak. Madness/olfactory failure? Cold shower. It’s been a lot.
-
Can I suggest you check the firmware on your SSD…
Let me narrow my guess: They hit 4 years, 206 days and 16 hours . . . or 40,000 hours.
And that they were sold by HP or Dell, and manufactured by SanDisk.
Do I win a prize?
(None of us win prizes on this one). -
@zverok is maintaining this really nice overview of changes to the Ruby language over time. I didn’t know about a lot of the things I read here.
A very brief list of new significant features that emerged in Ruby programming language since version 2.0 (2013).
-
Nice tip from Rob Zolkos to check that all Ruby classes will be found and loaded in production.
I recommend running
bin/rails zeitwerk:check
in your CI environment. Just a good sanity check that all classes will load ok once deployed to production. -
If you tried Rust and stopped using it, why did you stop and what would make you try again?
-
Git has been improving it’s UX in recent years. This still catches me out often so is a welcome change.
With the newest version of Git 2.37.0, you can run just “git push” to push new branches. No more “–set-upstream origin”. Enable with:
git config –global –add –bool push.autoSetupRemote true
-
I’ve started writing a simple Neovim plugin so I’ve been learning a bit about Lua and the Neovim API. Take all this with a pinch of salt as I am probably wrong about a lot of this 😁
-
There seems to be a common pattern used to implement “modules” as Lua doesn’t have them built-in.
local M = {} M.foo = function(opts) -- do something end return M
-
Lua code for a plugin goes into
lua/
. You can reference other files using a dot.
or slash/
, but the dot seems more common.lua/foo.lua lua/bar/init.lua lua/bar/baz.lua
Can be required like this:
require("foo") require("bar") require("bar.baz")
-
You can use
:lua
to run Lua code directly. -
Lua doesn’t have regexes in the stdlib, but has “patterns” which can get you most of the way. I’ve been using Lua Patterns Viewer to help get to grips with them.
-
You can use
plenary.test_harness
to write tests! -
Want to make a HTTP request from your plugin?
plenary.curl
is acurl
wrapper that is surprisingly easy to use, so far. -
plenary.nvim is great in general. Thank you @tjdevries.
Lua is slightly weird, but feels more like a programming language that I can actually use, which I can’t say for Vimscript. Ask me again in a few weeks!
-
-
I use GitHub-style Markdown for keeping notes and heavily use the checkbox notation like this:
- [ ] Do something - [x] Something I've done
Which is why I was excited to find
vim-checkbox
via VimTricks this week. It lets you type<leader>tt
to toggle checkboxes from anywhere on the current line. -
The heat this week has not be conducive to getting work done. I can’t wait for it to be over.