Open Chrome in Incognito Mode from Alfred

 

This extension will allow you to open Google Chrome in its Incognito mode for those times you need a flash capable browser with the added benefits of Chrome’s private mode.

I like to mark the Chrome application to be ignored by Alfred so that when I start typing Chrome this extension is the only one that comes up, that way I use it every time. To configure this simply pull up the info for the Google Chrome application and add alfred:ignore in the Spotlight comments.

 

 

Now install this Alfred extension: Open Google Chrome

This extension just executes the command:

open -a Google\ Chrome –new –args -incognito

/via Cool Geex

Again, I have no idea why anyone would ever need this extension but here it is if you want it!

Tested on Mac OS X Lion 10.7.2 (11C74) – Google Chrome 10.0.874.106

Prefixr Text Filter for BBEdit

Intro


In BBEdit, Text Filters accept the selection range (or entire document, if no selection) as input, and return text that replaces the selection range (or document). They may contain Unix scripts, AppleScript files, text factories, and Automator workflows.

Text filters are saved in one of the following directories:

  • ~/Library/Application Support/BBEdit/Text Filters
  • ~/Dropbox/Application Support/BBEdit/Text Filters

To use a Text Filter, select Apply Text Filter from the Text menu or assign it a keyboard shortcut from the Preferences > Menus & Shortcuts > Text > Text Filters

The Filter


Prefixr is a great web service with a simple API that will accept a CSS3 input and return the cross-browser compatibility format for that input.

Their API documentation had several example uses with certain text editors but no BBEdit.

  • Command Line / Terminal
  • TextMate
  • Espresso
  • Vim
  • Alfred
  • Coda
  • Phing (Build Script)

I decided to write my first BBEdit text filter by modifying the code for the Command Line example.

You can download the filter here: Prefixr CSS

Extract the file to one of the afore mentioned Text Filter directories and assign it a keyboard shortcut if you so choose.

I gave this filter a keyboard shortcut of ^⌥⌘+P simply because it was available.

Check out the video below to see the text filter in action, it demonstrates processing selected text as well as processing the entire document.

Keeping iTunes in Sync

Notification Image I just bought my second Apple computer ever, a brand new 13″ Macbook Air maxed out to the MAX! For the first time I am having to look at my setup in a new light. I am so use to having all my information on one computer, just doing backups and using Dropbox as my personal versions system. Now I have to consider what information I want on each computer and what information I want to sync across both. The Macbook Air will become my primary computer but I want my iTunes library on both because the secondary computer will remain at home, always on, and accessible by the AppleTV. For most situations, my free Dropbox account has been more than enough for my syncing needs. I am starting to question that now since I definitely don’t have enough space for syncing my iTunes library. My first thought was to pay the $10 a month for premium Dropbox account but I am cheap and I wanted to at least explore cheaper options. My second thought was to automate this job with a shell script.

I started by considering the conditions I would want this sync to run so it wasn’t using unnecessary resources.

  • Only run the job at home
  • Only run if the secondary computer was running
  • Exclude the Movies directory
  • Must be two-way sync
  • Log output and errors to a log file

I used the command line airport utility to check the currently connected SSID, if it matched my home network then it knew I was at home. I then pinged my secondary computer, if it responded, the script continued, if it didn’t respond the script simply closed. I then threw in some Growl notifications to indicate when a sync had been started and when it had completed so I didn’t accidentally turn off my computer during the process. Finally I ran rsync to compare and synchronize each directory, emulating two-way sync to ensure that both computers had the same data. I also skipped the Movies directory because I do not want all of my movies on my Macbook Air’s SSD. I save those for the home computer that will serve content up to the AppleTV.

DISCLAIMER

Before we get to the code, don’t blame me if you fuck up and delete your iTunes library. I started with my library on BOTH computers. I used rsync to move the library to my new computer since rsync will copy the files initially anyway but you can use whatever you want for the initial move. Even though I just wrote/used this script and it worked like a champ, I have to say I know what I am doing, if you are unsure about what you are doing, then for fuck sake back up your library or use rsync’s –dry-run option FIRST and read the log to see what changes would have been made.

OK. So let’s make it all work.

First you will have to have SSH enabled on the secondary Mac and you will need an RSA key on the server so you can log in without typing in a password each time. Instead of explaining how to do this, I will provide you with this link to an amazing website that will walk you through the whole process. I promise it only takes a minute, its really easy. Here is the link: SSH Keygen. It doesn’t show you how to enable SSH on your Mac, but if you can’t handle that then close this window and do not continue.

The Code

Below you will find a link to download the script. Be sure to utilize the download link and not just copy the embedded code, that is just for illustration of this article.

Take a look at the code, download it, and continue reading.

Once the script is downloaded, open it up and customize the variables

  • REMOTE_USER – The user account on the second computer
  • HOME_SSID – The name of your wireless network
  • DIR – The full file path of your local iTunes directory
  • SECONDARY – The computer name of your secondary computer

Save and close the script.

Make it executable by running this from the terminal

chmod +x sync.sh

Get it to Run Automatically

I wanted to run the script hourly but you can run it whenever you want. I thought about using cron but decided on launchd since it is the more powerful younger sibling to cron.

I saved the sync.sh script in to the directory: ~/Library/LaunchScripts/ (make this folder if not there)

I created a new launched plist file in ~/Library/LaunchAgents/ called com.binaryghost.SynciTunes.plist you can of course, name this whatever you want.

Here is the code inside the plist file, be sure to change the path to your script:

Once you have the script and the plist file in the correct place, just reboot the computer to let launchd load your new plist config and away it goes :)

I also created an Alfred command so I could quickly launch it manually if need be.

alfred

Enjoy!

Support your favorite apps!

I am dubbing today Support Your Favorite Apps Day! It’s a lazy Sunday, you know you don’t have anything to do anyway. So why not pick 5 of your favorite apps, jump on the Appstore and give them a great review. I actually stopped reading reviews a long time ago but a developer friend reminded me that they still have a great effect on the average consumer. I am guilty of loving apps and only praising them on Twitter, I forget to go back to the Appstore and give them praise.

So today my 5 world class apps are going to be:

(All links are to iTunes/Mac Appstore)

 

Now go rate some damn apps!

Send HTML emails from your iPhone

I know that HTML emails are not for everyone. Some people even hate getting them. I don’t care, I was bored and wanted to take a crack at it. If you want to try it, then follow along.
Read the rest of this entry »

watermarker-ad
thumbtack

Archives