Post

May 14, 2025

AI is Not Just for Coding Faster

AI isn’t just for writing code faster. I used it to build a custom study plan and wrap my head around some concepts without getting lost in the docs. Here’s how it worked and how you can use it too."

Sep 05, 2023

Add style to Django forms with TailwindCSS

You can style Django forms with Tailwind CSS without Crispy forms or installing any other external libraries. If you already have Tailwind CSS installed in your Django project, all you need is Django’s built-in “widget” feature, more specifically, the attrs field.

Jun 19, 2023

Book review: “The Software Craftsman”

I recently read the book The Software Craftsman: Professionalism, Pragmatism, Pride, by Sandro Mancuso and it highly resonated with me. Here’s an overview of the book with some of the highlights I made while reading it. I hope it piques your interest too.

Jun 05, 2023

Django Testing: Dynamically Accessing Attributes in Unit Tests

In this blog post, we’ll explore a way to write unit tests for a Django model using Model Mommy. Our main focus is on the update_dog_from_data function, which updates a Dog object with JSON data. However, the highlight is the technique to dynamically access attribute values in the tested object. By the end, you’ll learn some unit testing strategies and gain insights into dynamically interacting with object attributes during testing.

Mar 22, 2023

Git Squash Tutorial: How to Combine Git Commits for a Clear and Organized Commit History

A while back I wrote about managing local git branches with git rebase and I mentioned that I always submit my code changes with one commit only. No matter how many commits I make during my development process in my local branch when I prepare my code for code review and push it to remote, I squash all commits into one single commit, with one single commit message using git rebase.

Mar 01, 2023

TIL: time travel with Python’s standard library

There are a few different approaches for writing tests for date and/or time-sensitive functionality. One could choose to add a sleep() in the test, which would guarantee that the time passed, but that also has the downside of increasing the run time of the test.

Nov 23, 2022

Book review: The Programmer’s Brain

As a software developer, I usually self-refer as a “Professional learner” and this book’s subtitle ("What every programmer needs to know about cognition") caught my eye right away.

Nov 08, 2022

Como reverter um commit no git

Existem algumas maneiras diferentes de desfazer as coisas no git, mas para o propósito deste post vamos considerar o seguinte cenário:

Oct 25, 2022

TIL: installed packages in Python – list, and show

If your Python project has a very short list of required packages (in requirements, pipfile, etc), it’s easy to see all packages you have. But on large projects, the dependencies can run pretty long, not to mention the dependencies for the required packages. And what about learning more about those dependencies?

Oct 11, 2022

How to revert a commit in git

There are a few different ways to undo things in git but for the purpose of this post we will stick with the following scenario:

Mar 03, 2022

Managing local git branches with git rebase

When you work on a codebase with other people, you need to manage your local branches: you need to ensure that when you push some code and create a merge/pull request on the remote branch, your changes will be easily integrated with the main codebase. And by “easily” I mean preferably without merge conflicts or the dreaded message “your branch is xxx commits behind the target branch”. ?

Jun 30, 2021

A caller id for your python function

Most of you might be too young to know this but there was time that the phone in your house - not in your pocket! - would ring and gasp! you had no idea who was calling! You had to ANSWER the phone to find out. :scream:

May 26, 2021

git stash 101

git is a very useful tool for software development and you only need to know a few commands to get most of the job done. However, you can be a lot more productive if you go beyond the basics.

Oct 14, 2020

Developing inside a Docker container

A few months ago I got a new computer and I have been very intentional about deciding what I install on it. From past experience I know that computers that are used as a development environment tend to get messy in no time since one might install all kinds of libraries, frameworks, dependencies, you name it, and to makes matters worse, you will probably run into version conflicts for any or most of those things. Hardly ever a development environment is a clean environment and I don’t know about you but there are very few things that I find more frustrating than wasting time troubleshooting development environment set up. Let me write the code already!

Sep 30, 2020

How to permit nested parameters in Rails

The context Rails 5 introduced a big change in how it handles ActionController::Parameters (the parameters that you get on your Controllers): before Rails 5, if you called your params you would get a hash back and after Rails 5, you get an ActionController::Parameters object. You can see that by calling params.inspect and if you call .to_h on these parameters you should be good to go.

Sep 16, 2020

5 razões pra começar a aprender JavaScript

Se você já programa há algum tempo e não sabe JavaScript ou se está pensando em aprender a programar e não sabe por onde começar, aqui está a minha lista de motivos porque eu acho que você deveria aprender JavaScript (ou simplesmente “JS” no resto desse post):

Sep 02, 2020

Git, GitHub and GitLab. Are they all the same thing?

A few years back when I got serious about learning to program to become a software developer, I remember hearing about version control and getting really confused about git and GitHub (one can add GitLab to this list also!). Are they the same thing? Eventually, I figured it out but this past week in a conversation with a coworker, who is interested in getting into software development, I noticed that they also were confused about this so I decided to write about it.

Apr 09, 2020

Find the commit that introduced a bug in your code: how to use git bisect in 7 steps

When I first heard about git bisect I thought it sounded scary and complicated, so I never looked for an opportunity to learn more about it and use it. That’s until last week when I ran into a bug in our master branch. I knew that the bug was not there two days before so I tested an earlier commit and confirmed that that older commit was a good one. Now, we had tens of commits in between. How to find out when exactly the bug was introduced? It would be impractical to check and test each individual commit.

Mar 26, 2020

How to upgrade Rails

I don’t write much about Rails here but whoa, two posts in a row! Well, it turns out that I thought I should record another lesson I learned while upgrading Rails: how to do it, meaning, what are the practical steps one should take to upgrade Rails?

Mar 12, 2020

6 Lessons learned from upgrading a Rails app

I was recently tasked with upgrading our Ruby on Rails application at work: my goal was to move two major versions up, with a middle step on a minor version (and a server OS upgrade that was not even planned!). This was an incredible experience and I learned a lot from it. Here are some take-aways I can share:

Feb 27, 2020

Book review: Get Programming with Go

Learning Go (a.k.a as Golang) was one of my personal goals for 2019 and I chose the book “Get Programming with Go”, by Nathan Youngman and Roger Peppe as my learning resource. Even though there are several other resources out there, I chose this book because they state on their website that “[it] introduces you to the powerful Go language without confusing jargon or high-level theory” and I like to have a physical book to reference to when learning a new code language. Go is also my first statically typed language, so I was looking for something that would walk me through from the very basics.

Feb 13, 2020

Go to line number in a file using vim

You want to see line 3842 of file called my_super_long_file.py and you can only access that file using vim. You open the file and to your dismay, by default, vim doesn’t display line numbers. Here are your options:

Nov 13, 2019

TIL: docker commit

When I need to create a new custom Docker image, I usually start with a base image (alpine, debian, python, etc, depending on the project), running it in the interactive mode and install the tools and dependencies I will need. Once I get my container the way I want, I create a Dockerfile with all the commands I ran inside my container. It works, but I just learned that this might be unnecessary extra work.

Nov 06, 2019

TIL: How to move a line in Vim

For a text like the following: This is the line I want to move. This line should be the first line. In order to move the first line down, in normal mode* (not edit or insert mode), follow these steps:

Sep 25, 2019

Remove a commit from history in Git – local and remote

I recently committed an API key to a repository and even worse, I pushed to GitHub before I realized my mistake… 🙁 Removing the key from the code base wouldn’t completely solve my problem since a commit diff would still display my secret key. The solution was to remove that commit from history.

Sep 03, 2019

Getting started with gRPC – part I: the what

I recently spent some time researching gRPC and this post is a summary of what I learned. I also wrote a prototype application to test gRPC and gRPC-Web with Python and JS. The JS client takes a string from user input and test if it’s a palindrome. The code can be found on GitHub and in a future post I will comment on it.

May 16, 2019

Sending docker container logs to a separate file

In a large web application, the backend logs can get quite verbose: requests created, sent, processed, received, etc. The list can grow large very quickly depending on how logs are implemented.

May 03, 2019

Book review: Think Like a Programmer

Note: I’m not being paid or receiving any kind of compensation for this review. TL;DR: This is a very good book. If you are a software developer I highly recommend it!

Apr 19, 2019

Debugging Python applications (plus free cheat sheet)

My primary debugging tool is to add print statements to my programs</confession_time>. Print statements are very easy to use and they work well for any simple scripts. But that’s the catch: if you’re debugging an application and/or a test file, print statements won’t be enough or will just not work (in the case if tests files).

Apr 05, 2019

Command line shortcuts

I normally don’t use many shortcuts because it’s easier to just use my arrows and mouse to navigate than to memorize shortcuts but I am slowly realizing that the time spent on learning a new shortcut pays off.

Mar 08, 2019

Display nested dictionary content sorted by key in Python

Given a nested dictionary like this: dog_breeds = { 'Labrador Retriever': {'life_span': 14, 'male_weight': '36 Kg', 'female_weight': '32 Kg'}, 'Beagle': {'life_span': 15, 'male_weight': '11 Kg', 'female_weight': '10 Kg'}, 'German Shepherd': {'life_span': 13, 'male_weight': '40 Kg', 'female_weight': '32 Kg'}, 'Jack Russell Terrier': {'life_span': 16, 'male_weight': '8 Kg', 'female_weight': '8 Kg'}, 'Rottweiler': {'life_span': 10, 'male_weight': '60 Kg', 'female_weight': '48 Kg'} } here’s a way to display its content sorted by key:

Feb 08, 2019

Networking for Developers – part 2: application and transport layers

NOTE: Catch up with the previous posts in this post series: Part 1: Overview The Network Stack has four layers: Application, Transport, Network (or Internet) and Physical. This post will cover the top two layers: Application and Transport and together they help the destination computer identify what type of data it’s receiving through the network.

Jan 25, 2019

Networking for Developers – part 1: overview

For some reason grasping the concepts around computer networks has always been hard for me. Not surprisingly, I find that I’m not the only one: many software developers don’t really understand how computers networks… work. All I know is that I send stuff via the internet and my stuff gets where I wanted it to go. But how does that happen? Magic?

Jan 11, 2019

Customize your terminal prompt with colors

NOTE: the steps below assumes you have a Bash shell. If you are using a Unix machine (Mac or Linux) and are not sure what type oh shell you have, it’s probably Bash.

Nov 30, 2018

Map a string in Python with enumerate

Problem: create a map of the letters and indices in a string. My first approach was to loop over the string using range(len(s)), and checking if the letter exists in the map before adding it:

Nov 23, 2018

One year as a software developer

This past week marked my first anniversary as a full-time software developer. I thought it would be important to stop and reflect on these last 12 months so this is my “Year 1 retro”. You can read more about my background in the ‘About’ page but here’s the TL;DR: I am a self-taught software developer.

Nov 16, 2018

Docker: most used Docker commands

Docker has been around for a few years but it sounded too complicated and I never knew exactly what problem it was solving. Only recently I learned about it and started using Docker both at work and on my personal projects.

Nov 09, 2018

Git: most used git commands

Here’s a list of the git commands I use most often: git status when to use it: to know what is the status of the files in your branch. It will show what files have been modified, added, removed, committed, etc. A snapshot of your branch’s current situation. It’s super safe because it doesn’t change anything. It just give you… the status. I git status everything, every time.

Nov 02, 2018

Send long terminal output to a log file

There are times when a command line output is too long and it’s hard to scroll through all the lines to see the beginning of the stack trace. This usually happens when you get errors and the best way to fix errors is to read the very first few lines to understand what error message you got and where the error is coming from.

Jul 21, 2018

200 days of coding

Long story short, today I completed 200 consecutive days of writing code. It most definitely deserved a special treat.

Jun 16, 2018

Hello world!

UPDATE: At the time this post was published the blog’s name was print(f’{greeting}') What does this blog name mean?