The first workflow is a simple one called 'Insert pry'. I use pry for debugging my rails projects. It has it's pluses and minuses but overall I find it to be the most comfortable for me. In order to add a breakpoint in a ruby/rails for pry, you need to type "binding.pry". With this workflow, all I have to do is press CMD + ALT + P and it will automatically insert a breakpoint to the app I am currently using. Yeah, I know, it's not really life changing, but it will save you a little time throughout the day. :)
The second workflow is called "Insert DOOM". A lot of times when designing new features, the text for these features is only ready towards the end of the development process. I used to just write a few words like "this is the text" but I found out that adding a paragraph helps visualize how the page will look when it's done. So I created a workflow which inserts the first paragraph from Lorem Ipsum. This worked well for me for a while until I stumbled upon this blog post. The post suggests that by using a text like Lorem Ipsum, you are reducing the text element to a visual design element (like a shape). Sure this was better than just writing "this is the text", but I knew I could do something better. So I decided to take my workflow and change the text to the first paragraph from wikipedia about the game DOOM (best game ever). This way I had a few lines of real text and whenever somebody sees this text in a form or paragraph they read it and smile, and not just skip it. I use CMD + ALT + L to insert the text.
The last workflow is "Terminal Rails". I use ZSH for all my terminal uses. I noticed that many people have at least 4 tabs open when developing a rails project:
- Rails server
- Rails console
- A prompt for git commands, ssh, etc.
- Guard rspec
I noticed that this configuration of multiple tabs caused a 'big' waste of time when having to switch through them. That's when I decided to make this workflow. This workflow has 2 functions:
1. If you launch Alfred (usually alt + space) and start typing 'rails' you will get an option to launch this 4 tab configuration automatically. I programmed the workflow to start the rails server and console but not to start the guard (I don't like guard running when I don't need it). The 4 tabs will also have the corresponding name in their tab title.
2.After launching the 4 tabs, you will be able to switch to them from anywhere (not just while the terminal is focused). I have set the following shortcuts for this:
- rs - Will switch to the rails server tab
- rc - Will switch to the rails console tab
- prompt - Will switch to the prompt tab
- guard - Will switch to the guard tab
I use these workflows daily and they save me a little time everyday. I think the reason I like them so much is that I don't have to take my hands off the keyboard, grab the mouse, look with my eyes for the terminal, click on the tab, etc.
I encourage you to use Alfred workflows and create new ones yourself. Here are a few resources that will help get you started:
- Alfred forums - The main forum for sharing workflows and getting tips and ideas for making new ones.
Have fun!
Eyal.