Moncef Belyamani

Coding, productivity, and Mac automation tutorials for beginners and beyond.

Why I’m Coding for America

May 23, 2012. I’m attending TechCrunch Disrupt NYC with several AOL colleagues to celebrate the release of the TechCrunch iPad app. We’d been given the opportunity to attend the last day of the conference in recognition of our hard work.

Todd Park (the CTO of the United States) and Steven VanRoekel (the US CIO) happened to be speakers that day, and their passionate and spirited talk on innovation in the government blew me away. I started following Todd Park on Twitter, and that same day, he mentioned Code for America in a tweet. I had not heard of them before, and the name sounded intriguing, so I proceeded to follow them as well. Shortly thereafter, I found out about the open application for their Fellowship program.

How to Install PostgreSQL on a Mac With Homebrew and Lunchy

This is a quick guide for installing PostgreSQL (Postgres for short) on a Mac with Homebrew, and starting and stopping it with Lunchy. If you’ve just forked a Ruby on Rails project that requires Postgres, this tutorial will get you up and running in no time.

If you’re working on a brand new Rails app and need to create a new Postgres user and database for your app, I recommend Will Jessop’s tutorial or Peter Cooper’s screencast.

List the Largest Folders on Your Mac in One Keystroke With Keyboard Maestro or Quicksilver

In preparation for backing up my large Dance Music library to Dropbox (in order to sync it between my iMac and MacBook Air), I wanted to start by deleting all the songs I won’t miss. Finding individual files over a certain size is easy via the Finder, but I wanted to find out which folders (i.e. albums) were over 500MB so I could tackle them first.

There is no Folder size option in Finder’s search (afaik), so I did some Unix command research and found the wonderful du (short for disk usage). By default, du lists the folder sizes as multiples of 512 bytes, but you can easily change that to 1024 bytes with the -k flag. So, if you wanted to see the size of all your Dropbox folders, you would run the following command in Terminal:

Email the URL and Title of the Current Web Page in One Keystroke With Keyboard Maestro

I’m a big fan of efficiency, and this is one of many timesaving macros you can create with Keyboard Maestro. If you’re already familiar with Keyboard Maestro variables and tokens, you can skip the tutorial and download email URL and title of current web page.kmmacros from my Keyboard-Maestro-Macros repo on GitHub, then import it via File -> Import Macros....

Once imported, it will be placed in a “Browsers” Group that defines the applications in which the keyboard shortcut (aka Hot Key Trigger) for the macro is enabled. I added Safari, Chrome and Firefox to the Group. Before you run the macro, you should at least edit the email address in the Insert Text action. You might also want to change the Hot Key Trigger and/or the email client launched by the macro. Once you’ve tested the macro on your machine, you should add an action at the end that actually sends the email.

For those of you who are new to Keyboard Maestro, let me walk you through the process step by step.

How to Fix the GitHub Aside in Octopress 2.0

If you’ve added the GitHub aside to your Octopress 2.0 blog, you probably noticed that it’s been been displaying Status updating...instead of your repos. That’s because Octopress 2.0 uses v2 of the GitHub API, which has been retired in favor of v3. For some reason, the fix was only incorporated in Octopress 2.1, which has not yet been officially released.