We love reading, watching, and listening to constantly update our skills and learn new perspectives. Here are some of the exciting pieces we learned from this month.
Hotwire, ViewComponents and TailwindCSS: The Ultimate Rails Stack
If you're concerned about ensuring consistency in Tailwind stylings across elements in your site, and you have some logic to encapsulate the rendering of those elements, ViewComponents may be the right solution for you. Sprinkle in some Stimulus and Hotwire for interactivity!
The documentation system
Having supporting documentation can elevate the usability and understanding of any offering - but how do you know you've written good documentation? This site proposes that there are four distinct elements that go into sufficient documentation:
- Tutorials
- How-to guides
- Technical reference
- Explanation
Read through the source to learn about the differences and application of each artifact.
Redis rate limiter
Redis is sometimes only considered as the backing store for job queues - particularly in Ruby with Sidekiq. However, Redis is a general-purpose in-memory store, and can be used for many things. This article explores one such additional use for Redis.
As a bonus, Rails developers should take a look at kredis, an abstraction for accessing Redis now available under the Rails organization.
PostgreSQL rocks, except when it blocks: Understanding locks
Row or table locking is not something that, thankfully, we need to consider often. However, it is important to be aware of what operations will lock sections of the database for use, what the impact will be - and how you can leverage that affect in your application.
Preemptive Pluralization is (Probably) Not Evil
Contributing code that meets the current needs is tables takes - and we don't want to over-engineer solutions. However, considering potential future states as well as identifying the possible difficulty in getting there that can be avoided by a choice today is an important part of the job to build maintainable, scalable systems.
Add encryption to Active Record
HEY added encryption at rest to attributes in their database, and that is now being abstracted into Rails. While there are a number of gems or options to do this today, it'll be interesting to see this as part of the framework already. I particularly appreciated the forethought to consider rotation of encryption ciphers with the inclusion of a previous
attribute.
Rails 6.1 adds nulls_first and nulls_last methods to Arel for PostgreSQL
Before reading this, I didn't know that Postgres had the ability to control whether null attributes appear first or last in an order by statement. Turns out, it's been around for a long time, and now it's in Arel too in Rails 6.1!
Helping engineering teams adapt to a new normal
On this (unceremonious) year anniversary of when many US firms went fully-remote (not by choice), take stock in the initiatives you tried. Consider what you might try in the future to make things more comfortable and productive for yourself and your team in these unprecedented times.
curl is 23 years old today
Happy Birthday curl! This documents the journey along the way.
What Stevie Ray Vaughan Can Teach Us About Security Design
My favorite quote from the late blues guitarist is:
I use heavy strings, tune low, play hard, and floor it. Floor it. That's technical talk.
After reading this story, consider the impact on another kind of technical talk: shared access to the same resource, and shared keys to different resources.
Contributors
Learn more about how The Gnar builds software.