We’re Hiring: iOS Product Developer
Trim Agency is seeking an iOS developer to join their startup studio. The ideal candidate will not only love to code, but love to see companies grow from zero to launch, and scale companies from one to n. The Trim product mobile stack for iOS is Swift (or Objective C) / Rails API / Postgress […]
Testing Modules in Rspec
There comes a time when we might need to write some unit tests for a module. To do this, we can just extend some class and test the methods on that class. Here is an example using Rspec’s subject class; extending it with SomeProject::MyHelpers to unit test a method called :helpfulness.
Rails Forms: Validating and Persisting Duplicate Parameter Names
Building Rails forms is a pretty straightforward process but, once in a while, I run into a ‘gotcha’ that needs a simple solution. This week I was building a form where, if the user selects a particular subset of radio buttons, a text field is shown and the user is required to enter a string. The […]
Rename a Phoenix Application
When we build a Phoenix application with $ mix phoenix.new my_app, our application module name is set to MyApp. This module name, as well as the snake case version, is referenced everywhere, making it very cumbersome if you need to ever rename the application. Here is a shell script I wrote the does the job […]
Common Table Expressions in Postgres
PostgresSQL WITH Queries, also known as Common Table Expressions (CTEs), allows us to write complex queries by defining temporary tables for use in a larger query. In other words, we can create in-memory temporary tables and query against them. Here is an (trivial) example where we want the email addresses of all the users who […]