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? pip list Will list … Continue reading TIL: installed packages in Python – list, and show
Category: til
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 … Continue reading Find the commit that introduced a bug in your code: how to use git bisect in 7 steps
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 … Continue reading 6 Lessons learned from upgrading a Rails app
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: Arrow down and hope you find that line before retirementDisplay the line numbers by hitting : and … Continue reading Go to line number in a file using vim
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 … Continue reading TIL: docker commit
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: place the cursor at the beginning of the line you want to move - in … Continue reading TIL: How to move a line in Vim
TIL: Create and deploy a serverless function in AWS
Only two steps required (it assumes an existing account in AWS console): Create a Lambda function in AWSDeploy your Lambda function with AWS API Gateway I used these two articles as a reference: Going Serverless: how to run your first AWS Lambda function in the cloudWorking with Amazon API Gateway Important notes the lambda function … Continue reading TIL: Create and deploy a serverless function in AWS
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. Removing commit … Continue reading Remove a commit from history in Git – local and remote