Archive for March, 2008

Mar 19 2008

Mass Rename File Extensions

Published by under System,Tools/Utilities

I recently had to rename somewhere in the neighborhood of 100+ files as I was moving code from one platform to another. Obviously, I was looking for a quick solution, and what follows is the shell (Bash) script that I used to do the job:

Continue reading...

4 responses so far

Mar 17 2008

Ruby irb Command History

Published by under Ruby

If you spend any amount of time working with Ruby in the interactive shell (irb), what follows is a handy script for adding command completion support as well as command history across irb sessions.

Continue reading...

Comments Off

Mar 17 2008

DOMAssistant Bundle

Published by under TextMate

As a huge fan of TextMate and always one on the lookout for new bundles, I want to pass on interesting DOM Assistant bundle developed by Roger Johansson over at 456 Berea Street.

Continue reading...

Comments Off

Mar 16 2008

Rails Call for Papers Countdown…

Published by under Events

There are just two days left in the Call for Papers for the Rails Europe 2008 conference. The final deadline for papers is midnight on March 18th, 2008!

Continue reading...

Comments Off

Mar 15 2008

“FireBug Like” Tools in Safari

Published by under Defaults,Safari

Most all web developers, most certainly those who work with Firefox, are familiar with Firebug. This tools nevers ceases to amaze me, the ability to change information (for example style attributes) on a webpage as your are viewing the page, is amazingly useful. Version 3.x of Safari now includes the option to enable a Firebug like debugging tool called Web Inspector…

You won’t find access to Web Inspector in your default installation of Safari. However, making the necessary configuration changes is as easy as running the following command from a Terminal:

defaults write com.apple.Safari WebKitDeveloperExtras -bool true

If you prefer, you can use the Property List Editor to set the WebKitDeveloperExtras property in the Safari property file, which is located here: ~/Library/Preferences/com.apple.Safai.plist (use Finder to locate the file and double click to open). You’ll need to restart Safari after making the changes to enable Web Inspector.

To open the Web Inspector, right click and choose Inspect Element as shown in the figure below:

With Web Inspector running, you have access to a goodly amount of information. Take a look at the screenshot below which shows content from the Google homepage.

While poking around on Web Inspector, I clicked on icon in the lower left corner (the little arrow-in-a-box) and a popup menu appeared showing options for Network and Console. I selected Network and information about document and image transfers appeared (see the figure below). The Console option in this same menu resulted in a blank page appearing, so it seems I still have some exploring to do to figure what this option is all about. If you click on the icon just to the right of the arrow-in-a-box, the Web Inspector will be shown in a split window view versus a popup window.

I haven’t found an option for editing “on-the-fly” as in Firebug, however, Web Inspector is a good start for a built in tool and I have no doubt it will continue to evolve….

29 responses so far

Mar 14 2008

Ruby, an AppleScript Alternative – Part 4

Published by under Ruby

My intention in starting this series of posts on Ruby was to re-write two short AppleScript applications; one that turns down the volume at shutdown, and one that resets the volume upon bootup. We’ve covered enough information up to this point to have all we need to write the Ruby version (using rb-appscript).
Continue reading...

Comments Off

Mar 14 2008

Terminal Focus Follows Mouse

Published by under Defaults

The followings two tips are for those who spend any amount of time in terminal windows. The first tip shows how to configure focus follows mouse, which is handy when you jump between multiple terminals. The second tip demonstrates how to configure the default window settings so when inside a terminal and you create a new terminal (in either a tab or window) the window settings match your preferred look and feel.
To configure focus follows mouse, enter the following in a terminal. You will need to close and re-open all open terminals:

defaults write com.apple.Terminal FocusFollowsMouse -string YES

You can give this effect a try by opening two terminals and moving the mouse between them. Note, this only applies to two separate terminal windows, not two terminals in separate tabs within one terminal window.

The next tip will set the default window settings for each new terminal window that is opened (from within a terminal):

defaults write com.apple.Terminal "Default Window Settings" -string Novel

Novel is my preferred (configured) setting for a terminal. To see what I am referring to, from a terminal enter the Preferences dialog and look at the Startup setting, which is shown below:

This is a little confusing, let me clarify. If you look closely at the text in the dialog above, it states On startup, open:… which translates to…when I startup a terminal window, use the Novel window settings. However, if you are in a terminal already and open a new terminal (cmd-N or cmd-T), the default window setting is Basic. So, the tip above tells the system when I am in a terminal, and I open another terminal, using the window settings I specified (not Basic).

Both of the above configurations can be set by editing the terminal property list file located here: ~/Library/Preferences/com.apple.Terminal.plist. If you double click on this file, the Property List Editor will open the file and you’ll see the two properties mentioned in the tips above, near the top of the list:

And while you have the property editor open, go ahead and take a few minutes to tweak a few other options. I think you’ll agree there, is an an odd sense of satisfaction in customizing your system. You may need to restart any open terminals to see changes take effect.

One response so far

« Prev - Next »