Yearly Archives: 2015

find_or_create with Ecto

The Ecto library in Elixir apparently does not have a native find_or_create method comparable to Activerecord as of the time of this writing. However, here is a nifty method you can drop into one of your Ecto models to achieve

Posted in Uncategorized

Locking Records with Elixir’s Ecto

As a followup to a previous post about locking records with transactions, I’m now going to show how it’s done with Elixir, and specifically the Ecto library (comparable to ActiveRecord). Instead of using: Ecto asks you to pass the specific

Posted in Ecto, Elixir

Headless browsers and proxy authentication

For my most recent gig, I’ve been trying to drive Firefox headlessly using Selenium and a pretty excellent Elixir library called Hound. One of the tasks I needed to accomplish was to connect to sites through a proxy server that

Posted in Uncategorized

Closure Tree hierarchy counting

We use a nifty gem called Closure Tree in our Rails app to manage our application’s file manager hierarchy. It stores the entire hierarchy in a separate table so you don’t have to traverse the parent IDs recursively every time

Posted in Uncategorized

Elixirin’

Recently got roped into a side project for an old colleague and building something in Elixir using the Phoenix Framework. I’ve been using object-oriented (or somewhat OO languages like Perl) for the last 15+ years, so working with Elixir and

Posted in Uncategorized Tagged with: , ,

What the value was

Been programming with Rails for well over three years now, and only now had the need to know what an attribute was before you changed it. May be old hat for a lot of ya, but awesome when you get

Posted in Ruby on Rails

Nifty PostgreSQL Common Table Expression Update

D’ja ever want to target a specific group of rows that meet a condition in a database table, join it with information from other tables, and then perform an update on them in a single command? PostgreSQL’s Common Table Expressions

Posted in PostgreSQL

Fun with race conditions, concurrency, and deadlocks

Sometimes, wheels have to be a little squeaky before we can learn how to properly oil them. Once, a race condition was discovered within our Rails codebase that required a deep dive into concepts of concurrency which I hadn’t yet

Posted in PostgreSQL, Ruby on Rails

New Blog

Hi everyone! As a consummate web developer, and as someone who considers himself one who can turn a tidy phrase, it pains me to think I’m only now getting around to setting up a technical blog. ¬†Better late than never,

Posted in Uncategorized