Posts

Master S3 file renaming: use AI to skip the Bash learning curve

As a software developer, scripting is part of my toolkit for automating tasks, though it's not something I always look forward to. The need to rename multiple files in an S3 bucket presented itself recently, and the prospect of diving back into bash scripting—something I hadn't done in a while—was daunting. Recalling bash syntax isn't exactly like riding a bike for me; it usually requires a bit of a refresher. However, realizing I'm in the year 2024 made me think differently: why not leverage AI for this task? Enter ChatGPT, an advanced AI capable of assisting with a plethora of tasks, including script writing. I decided to test its abilities by asking for a bash script to rename files within an S3 bucket. To my delight, ChatGPT was up to the challenge and provided the following script: In conclusion, I was able to effortlessly write a script to rename files in an S3 bucket thanks to the help of ChatGPT. If you ever find yourself in need of writin...

Anonymous controller testing in Minitest

I believe binding.pry and Rspec respectively are the best things that could happen to Ruby world. I've been using both for the same time I've been using Ruby and I couldn't imagine using another testing library. Until recently, because I entered a project using Minitest.

Defining top-level scope methods in Ruby is risky

Defining methods in the top-level scope might immediately sound like a bad practice, but surprisingly, I’ve seen it appear in various Rails projects. Sometimes, this happens unintentionally, while other times, developers do it to make methods more accessible from different parts of the application. Here, I’ll explain why this approach is problematic and how it can happen without you even noticing.