Building a DSL in Ruby - Part 2

In the previous blog post, we implemented the first version of an example of a DSL library in ruby, a simple FactoryBot clone. In this second part, we’ll extend and improve the library so that we can also build associations between objects.

More …

Want to learn? Write it down

Over the course of my programming adventures, one of the best sources of knowledge, in my case, is videos and written tutorials. I don’t think I can get the same level of information retained by reading technical books (although I do want to improve in this aspect).

More …

Building a DSL in Ruby - Part 1

Have you ever wondered how libraries like FactoryGirl (or should I say FactoryBot?) work? Or Rails routing? It all seems a bit like magic sometimes doesn’t it? Let me debunk all of that for you! These libraries are not using any tricks under hood, it’s just plain old ruby, except they’re using a few advanced aspects of the language that you might not have known about. To demonstrate that, we’ll write a simple and functional clone of FactoryGirl, Construction Girl (I couldn’t think of a other better name).

More …

Open Source Made easy

Contributing to Open Source software can be overwhelming. There are a lot of projects that need help and welcome new contributors, but getting started can be hard.

More …

Streaming data in Postgres

The problem

Let’s say you have a table with millions of rows (in the order of hundreds of millions). In this scenario, you should think twice before issuing a query against such table. It’s usually not acceptable to do something like this:

FROM my_big_table
ORDER BY some_column

The execution time of such a query will be huge, and your client won’t see anything until this query is done processing and you have the results in the application. So how can we execute these queries without too much performance penalty?

More …