Ruby Enumerable Gonna Show You How It's Done, Done, Done

posted in article

 

I’ve been using Ruby for over 11 years now and along the way I’ve discovered many favorite methods that I keep coming back to. Many of my favorites come from the Enumerable module. I love the simplicity of finding a standard method that does the exact data manipulation. Being able to share these methods with other engineers is fun in of itself. So without further ado, here’s some excellent Ruby Enumerable methods to show you how it’s done, done, done.

Find or Create Records with Preset Attributes using create_with

posted in today i learned

 

I’ve been working heavily with RabbitMQ message broker infrastructure recently to coordinate events between two Rails applications. The event work involves maintaining synchronized data between specific shared data. In the past, I’ve implemented a find_or_create_by style of idempotent backfilling required associations. Today I learned about a separate syntax via create_with for presetting record creation attributes.

A Perfect terminal with Zsh, Antidote, Oh My Zsh, Powerlevel10k, and Mise.

posted in tutorials

 

I love to customize my development environment. Between operating system, editor, and terminal, I’m always reading through the configuration options to improve my workflow. Getting it to look pretty is also great since I spend so much time working with these tools. This article details my current setup for crafting a perfect terminal with Zsh, Antidote, Oh My Zsh, Powerlevel10k, and Mise.

Simple Background Jobs with After in Next.js

posted in today i learned

 

Today I learned about the after function for scheduling side effects which avoid blocking execution. Think of it as a simple background job scheduler. These are much lighter than a database or Redis backed queueing infrastructure. That being said, I’m still learning what the benefits vs. costs might be for this Next.js version 15 update.

Custom Naming for Database Tables, Columns, and Associations in Prisma ORM

posted in articles

 

I’ve been working with Prisma as an object-relational mapping tool for my projects. Coming from a background of using raw SQL along with ActiveRecord, I’ve noticed that default Prisma caters to JavaScript over other established standards. Ensuring database table columns are snake_case along with creating associations that are lowercase and plural doesn’t come for free but Prisma does provide a way to configure these within your schema.

ViewComponents, the Missing View Layer for Rails

posted in articles

 

If you’ve worked with Rails for any measure of time, then you know that Rails’ Views can quickly get out of hand. Between Helpers, instance variables, and inline logic, they quickly become bloated and tightly coupled to other view specific logic. Pushing these concerns into the Controller layer, or even a Presenter helps, but still lands the View in a place where it contains multiple responsibilities. If only there was a better way… Enter ViewComponents or as I like to call them, “The Missing View Layer for Rails”.

Setting up Mac for the Linux user

posted in articles

 

So you’ve got a new Mac. Maybe it’s a work laptop, maybe you are switching from another operating system. Either way, if you’re like me, you’ve got some set habits with your work environment. This article details all the configurations I do when setting up a new work laptop.