Automation is the new Agile (or the old one? 🤔)
I'm a big fan of automation. I've read once that if you do something manually twice, you should put it in the list "To Automate".
Always keep a list like that because, at some point, you need to unplug your brain from the task you are doing and change context to get some fresh air. Automation is fun when you know it will help your future self to be better.
Some tools I use that probably will help you as well
In this post, I just wanted to share some applications I use for development that are really helpful to save time. Let's go!
Gas Mask
One click /etc/hosts management
I like to test my development projects with the real domain names I'm going to use in production. That way I could find problems with CORS configurations or any other SSL related problems.
That means changing your `/etc/hosts` file more times than you would like during the day.
That's where Gas Mask it's awesome. It's a small application where you can define your host's file (many of them) and then switch back and forth to the configuration you are testing. Just click one button, no terminal, no vi, just like that.
You can even host your "hosts" files remotely, so you could share them with your team or version them. Shortcuts available if you don't want to leave the keyboard, of course.
Dash
Snippets and technical documentation
This is a well-known tool for developers on the move but has some great features I like even when I'm not working on a plane.
Dash lets you select a lot of datasets with documentation you can check offline about almost anything (programming languages, ansible, docker, terraform, man pages ...). There are official libraries you can download and community ones as well, so you'll find what you are looking for.
Anyway, when I started to use Dash it was because I wanted to find a place to save my snippets. Those little commands you use some times, but you are not able to remember exactly. At least that's what happens to me...
This tool has great support for snippets and text replacement.
Some additional features I like: snippets synchronization through DropBox, in case you have more than one computer, for instance.
BetterTouchTool
Short-cuts are your lifestyle
When I found BetterTouchTool I was looking for a tool to snap windows to places in my screen using shortcuts. It does a great job with it, but that's not all it does.
Nowadays is a full-fledged suite to customize a lot of things about how you interact with your computer.
Some examples:
- Assign shortcuts to almost everything:
- Switch spaces
- Move windows to any standard position on the screen (Fullscreen, half-left, half-right, etc.) or define your own customized areas.
- Customize the Touch Bar with things that finally made sense.
- Customize your trackpad and mouse actions with any option you can think of (including running scripts)
- Many more things I couldn't live without...
In addition to all that, if you have the paid version, you have access to a mobile app that you can use to trigger some automation, like when you are presenting something. Really cool feature.
Alfred
Much more than a Spotlight replacement
I spent many years knowing this tool was out there, but I always thought it was just a Spotlight replacement with some additional features (like searching the web directly from there and so on).
Some time ago, I read some articles about the Workflows feature inside Alfred, and then I discovered the real power of automation in the local environment. Workflows are a paid feature in Alfred. It lets you script whatever action you have in mind, using keywords as triggers and even using its own interface to capture parameters for your actions.
I think it's better to see some examples to understand what I'm talking about:
Log in into Docker containers
What is happening under the hood:
- Alfred reacts to my keyboard and triggers a bash script getting the names of all my active containers.
- Lets you select one of them, and then run the command needed to log into the machine with a command line available.
Timestamp converter
When you work with time-series databases or even with other databases, you deal with timestamps.
Most of the time it's ok because you don't need to check exactly the human-readable time many times but as soon as you have time-series to take care of, you realized that half of the day is checking dates.
This is something I used to do, a lot, opening a free online converter to check the timestamp.
Now I do this:
What is happening under the hood:
- Alfred reacts to my keyboard, waits for the argument (the timestamp).
- As you type the timestamp, it gives you several formats you can easily check.
- If you hit enter, copies to your clipboard the converted date.
Chained Workflows with Alfred
Finally, I wanted to show you a workflow where you use the interface to add some parameters and get the final result.
This time is triggered by a text-replacement so you could see how powerful it is to save you time.
I use this workflow when preparing some documents for the university. At the end of the document, you should add the links that you used as a reference in the documentation.
They have a specific format (which I don't remember most of the time) and it's a pain to write them.
So, I've created a chained workflow in Alfred that looks like this:
How does it work:
- Go to a website you need to reference and copy the URL.
- On the same website, copy the title of the page.
- Go to your document (Word or similar) and type "webo*". That triggers the workflow.
- Alfred appears and ask you a few questions to configure the output:
- Choose one of two types of formats for the reference.
- Based on your choice, it will ask you for more data (needed by the template) or if you choose the standard format, the information you have in your clipboard is enough.
- Pastes the result in your document.
Let's see it in action:
Think about this workflow as your IDE live templates with the possibility of being sourced with information from any of your applications.
As some used to say, the only limit is your imagination.
Hope you enjoyed it and thanks for reading!