I used RSpec’s
receive_message_chainthis week for the first time. I’m not sure how I’ve managed to avoid it for all these years. I generally consider it a code smell, as do the RSpec docs, but sometimes it’s the most sensible/readable way forward. In this case, stubbing an object over which I have no control.
Brighton Ruby conference is back this year and I managed to bag myself a ticket from the second batch. I’m really looking forward to it after a few years off. I’ve been going since 2014 apparently!
Formerly remote-first companies might find that their new office doesn’t fix their communication issues, but actually makes them worse.
Deploying to Fly.io with SQLite by Micheal Crumm shows how to deploy a Phoenix app to Fly with SQLite instead of Postgres. Once you know how it’s not that hard. I will be bookmarking this for the future.
I’m trying to improve my development workflow and part of that is perhaps moving my vim config into lua, or certainly using a lot more lua than I currently do. I was browsing TJ DeVries' dotfiles and came across
pcall- what is
Turns out that it’s how Lua does error handling, or part of how it does it.
For many applications, you do not need to do any error handling in Lua. Usually, the application program does this handling. All Lua activities start from a call by the application, usually asking Lua to run a chunk. If there is any error, this call returns an error code and the application can take appropriate actions. In the case of the stand-alone interpreter, its main loop just prints the error message and continues showing the prompt and running the commands.
If you need to handle errors in Lua, you should use the pcall function (protected call) to encapsulate your code.
From the wall of my local coffee shop.
When one burns one’s bridges, what a very nice fire it makes.
– Dylan Thomas