Managing Ruby on Rails development dependencies with asdf and foreman

Why not use docker? Yeah, I know, docker is cool and everything. But it might happen that you can’t use it or just don’t want in this basic project. Why should I care? It’s just a basic Rails project? Even the most basic of the projects will have dependencies Let’s face it, even on a basic Rails project you probably gonna to manage ruby version, database version, redis version, nodejs/yarn, etc....

March 1, 2021

Test/Lint only what matters

Test/Lint only what matters I mean, every thing matters. But, that’s why we have CI, when you’re working a very large project usually is very hard to run all the tests or lint all the files of the project locally. But would be nice to run tests/lint only for the files I changed/created on your feature branch, right?! Right!? What files did I change in my feature branch? I just recently learned that it’s quite easy to check what files you changed in your feature branch with git diff --name-only master....

November 27, 2020

Postgres Array Aggregation on Ruby on Rails

The problem In a blog, one may want to create a menu to filter the blog posts by year and month. A nested list, like: 2020 January February May 2019 January April May July August Querying the data There’s a few ways to do that, I’ll explore how one could could query the database to retrieve the required data using the array_agg to fetch an array of the months for each year....

June 18, 2020

neovim fzf with a floating window

I already mentioned the floating window feature that’s coming with the next version of neovim. This opens a whole new world of possibilities with neovim. One nice possibility is the power of using fzf.vim with a floating window: Well, this is actually a simple solution: " Reverse the layout to make the FZF list top-down let $FZF_DEFAULT_OPTS='--layout=reverse' " Using the custom window creation function let g:fzf_layout = { 'window': 'call FloatingFZF()' } " Function to create the custom floating window function!...

April 10, 2019

elixir-ls with coc.nvim

If you have been followig the neovim udpates about what’s to come on nvim 0.4, you’re probably excited with the new floating window feature. Well, I got very excited when I saw this nvim’s tweet This tweet shows how coc.nvim is getting ready for the new feature, so I decided to give it a try with elixir-ls. There’s a very good blog post about how to use elixir-ls with ale, but with this exciting news, I decided to try it with coc....

March 21, 2019

Parsing bash arguments recursively

The problem I’m a lazy developer, who tries to create scripts to automatize most of my daily mechanical activities. And because of that I have many many scripts on my dotfiles. Some of my scripts require arguments and often, due to my lack of memory, I had to research the best way to part arguments in bash. Usually I need to parse arguments in the following format: $ ./whatever option_a: | option_b: DEFAULT | option_c: $ ....

March 10, 2019

Ideas Some ideas that should became blog posts Ruby logic tables Logic and > [true, false].repeated_permutation(4).to_a.map { _1 << _1.reduce(:&) } => [[true, true, true, true, true], [true, true, true, false, false], [true, true, false, true, false], [true, true, false, false, false], [true, false, true, true, false], [true, false, true, false, false], [true, false, false, true, false], [true, false, false, false, false], [false, true, true, true, false], [false, true, true, false, false], [false, true, false, true, false], [false, true, false, false, false], [false, false, true, true, false], [false, false, true, false, false], [false, false, false, true, false], [false, false, false, false, false]] Logic or > [true, false]....