Bootstrapping Stencil #02 - A Parent's Guide

When I started working on Stencil, one of the main challenges wasn't technical. I've been a software engineer for about 8 years now and experience has taught me that most technical problems can be fixed with enough time. The real problem was finding the time to work. Most interviews on…

Polymorphic association in Ecto (Part I)

Polymorphic association in database is when you have multiple tables that need to refer to the same table. For example, I have table users that contains details like profile information. I then have two tables, guards and operators which both have profile information. I need to link that to users…

Piping (|>) to second argument in Elixir

Pipe operator in Elixir is great, you can compose your functions naturally. However, there are times when you want to pipe the input to the second argument. How would you do that? Desugar iex> sum_number = fn x, y -> x - y end iex> sum_number.…

Multi-tenancy with Ecto, Part 1

With Ecto 2.0, there is support for Postgres schema or multiple databases for MySQL. What I am trying to do here is to use Postgres schema to achieve multi-tenancy, and of course using Ecto. Disclaimer: This is mostly for my personal notes as I try to understand Ecto/Elixir…

Django multi tenant issues with Celery + Postgres

You can quickly build a multi-tenant site in Django with the help of this nifty package django-tenant-schemas. It works by assigning each tenant into its own database schema and having one public schema for anything that needs to be shared. It wraps Django's connection with its own wrapper that help…