Wrangle Your SQL With Arel by Eric Hayes

This is a fascinating talk that walks through the underlying APIs used to build SQL queries in ActiveRecord. Eric does a great job showing how ORMs use Abstract Syntax Trees to create SQL queries from hashes and method calls. The end result shows how they built an incredibly complex cohort query with efficiency and maintainablity […]

My Notes / Watch at youtube.com

Process HEIC Images with Node on AWS Lambda

I needed to add support for HEIF/HEIC images in my application and thought it would be a fun introduction to AWS Lambda. Since I have minimal experience with AWS and this was an exercise for myself I thought it would also be fun to use Sharp. The first thing I learned is that HEIF is […]

Continue Reading

How to use Trix Editor with React Hooks

I needed to add the Trix Editor to my React application and couldn’t find a simple solution. Since having an actual <input /> node in the DOM isn’t required, I opted to have the value bound directly the editor’s built in input node. Usage The Editor Component

Continue Reading

Github Actions with Rails and Postgres

Github Actions were recently made widely available and this workflow has been awesome. It runs Postgres in a docker container and installs the libpq-dev package for the pg gem. Enjoy! It’s important to note that this configuration runs Postgres inside a docker container with the port forwarded to a random, available port within the build’s […]

Continue Reading

Active Link To Helper

I’m often looking for a flexible solution for determining if I’m on the current route. I say flexible because sometimes a link is bound to a single controller, or sometimes multiple controllers, or multiple controllers with specific actions. Rails Helper Matcher Class Usage The API is somewhat complex to accommodate most use cases. Basic resource […]

Continue Reading

Who Knows Who or What?

A few years ago I had the opportunity to help build a social media platform designed to connect professionals with various connections. The idea being to index users based on companies or individuals they had previously mentioned having a connection to. While this is a problem I still don’t fully understand it was especially difficult […]

Continue Reading

Embeddings in Machine Learning

I’ve recently been tasked with applying machine learning and neural networks to classify documents at my day job. Everyday while working to solve this problem I have new realizations about this field which was completely foreign to me only a few months ago. I took what is called a top-down approach, which basically means diving […]

Continue Reading

Testing APIs

I recently had the opportunity to test an API and wanted to validate the results along with the structure of the response. When looking around on the internet for inspiration on how to solve this I was intrigued by the wonderful DSL created by Frisby. My goal was to not only test the security and […]

Continue Reading

Adding a User Manager to your Feature Tests

In my last post I described how to write declarative step definitions. However, this means our test cases can’t assume it knows who is performing the action because the user can change at any time. We’ll need to introduce a sort of state machine to track the current user and log in as another user when needed. […]

Continue Reading

Writing Acceptance Tests in Third Person

When I was learning to write acceptance tests with Cucumber everything started with “I”. It made sense because you were driving a browser to click buttons and fill in forms and that’s what “you” did. However, I recently realized this doesn’t work when writing tests that require multiple users to interact with the same test. […]

Continue Reading