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....

<span title='2021-03-01 00:00:00 +0000 UTC'>March 1, 2021</span>

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....

<span title='2020-11-27 00:00:00 +0000 UTC'>November 27, 2020</span>

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....

<span title='2020-06-18 00:00:00 +0000 UTC'>June 18, 2020</span>

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!...

<span title='2019-04-10 00:00:00 +0000 UTC'>April 10, 2019</span>

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....

<span title='2019-03-21 00:00:00 +0000 UTC'>March 21, 2019</span>

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: $ ....

<span title='2019-03-10 00:00:00 +0000 UTC'>March 10, 2019</span>

Ideas Some ideas that should became blog posts When a command needs a file as argument Some commands/scripts might need a file as argument, but you might want to echo something instead. Simple solution I found, instead of creating a file for a quick run: $ echo "Some thing that should be in a file" | command-that-requires-a-file /dev/stdin Since /dev/stdin is a readable file, this should work in most cases....