Weeknotes 43
24th April, 2022
“Retry anyway”
-
An interesting deep dive into how How EEx Turns Your Template Into HTML by Mitchell Hanberg.
-
I was introduced to Anyway Config from Evil Martians this week. It’s been around since 2015 but this was the first time I’d heard of it.
Anyway Config is a configuration library for Ruby gems and applications.
The core idea is that you encapsulate configuration values in objects rather than just reaching into the global
ENV
like almost all my projects up to now have done (with the exception of that one project that just committed production values into git 🙀).You can read configuration values from many different sources: YAML, TOML, Rails' encrypted credential files, environment variables etc. And they cascade allowing them to be overridden, which is useful in development.
I’ve written my own configuration classes before, but you do tend to reinvent the wheel each time, and of course, not everyone on the project does the same thing, so having some formalization seems like a good idea.
-
The recent GitHub/Heroku OAuth token related issues have been an eye opener for some. It continues to cause some issues for us, but workarounds are in-place. Maybe those production secrets in Git weren’t such a good idea after all? 😉
-
Simon Willison is building cool things again, this time a Covid sewage Twitter bot that takes a screenshot of Covid sewage data and tweets it out @covidsewerage. Apart from the technical side of things, I had no idea that it was possible to get information about Covid prevalence via sewerage water.
-
I’m using Tesla on a side project.
Tesla is an HTTP client loosely based on Faraday. It embraces the concept of middleware when processing the request/response cycle.
Being influenced by Ruby’s Faraday is no bad thing as I’m a fan of that library. It has suited my needs so far, worth a try if you’re looking for an Elixir HTTP client.
-
Stop Validating Email Addresses With Regex – a compelling argument. There is no such thing as checking for an email, only increasingly more complex, but incorrect, regexes.
-
How many of y’all knew that Ruby has a native retry mechanism?
I was vaguely aware, but have never used or seen it used in a codebase.