I recently heard about an RSS reader (can’t remember which) that had a feature to mark all messages older than a certain threshold as “read”. I thought this was an incredibly useful feature, since I often forget to check my feeds for days at a time, and end up with hundreds of unread items that [...]
This is an updated shell script / AppleScript for opening a new tab in your current directory (or the specified directory). The last version was for the pre-tabbed version of Terminal.
#!/bin/sh -
if [ $# -ne 1 ]; then
PATHDIR=`pwd`
else
PATHDIR=$1
fi
/usr/bin/osascript <<-EOF
activate application "Terminal"
tell application "System Events"
keystroke "t" using {command down}
end tell
tell application "Terminal"
repeat with win in windows
try
if [...]
A few months ago I started working on a JavaScript to Objective-C bridge. We had already implemented Objective-C in JavaScript, so I figured “why not?”
Well, I never got very far, but thankfully Patrick Geiller apparently had the same idea and actually executed it: He announced JSCocoa today. It looks like it’s a solid bridge, about [...]
One of the greatest strengths of Mac OS X, for developers in particular, is that it has a very elegant and consistent graphical user interface as well as an excellent command line interface. I’m not going to cover the basics like “ls” and “cd”, but rather point out some Mac OS X specific tools that [...]
Mac OS X comes with an Apache installation which is very handy, but by default it’s configured not to follow symlinks. A lot of times I have projects in other directories which I want to share via the web server, but end up getting errors such as the following:
Forbidden
You don’t have permission to access /~tlrobinson/Editor/ [...]
Back at MacHack 2003 Jonathan Rentzsch talked about how to override functions and inject code in Mac OS X using several neat tricks. He also released a framework called mach_star which has two components: machoverride and machinject. These are great, but overkill for some simple cases.
A much easier way of doing library function overrides is [...]
Following an interesting discussion on Reddit about first class functions in C, I was inspired to see what I could do with this new-found knowledge. The result is what I affectionately call “GCCalc”, for reasons that will become clear below.
GCCalc is a simple command line calculator, much like the common bc calculator on many Unix [...]
A lot of times I find myself wanting to open another (Mac OS X) Terminal window in the same directory as my current one. This little shell script, which executes a little AppleScript, makes that trivial:
#!/bin/sh
if [ $# -ne 1 ]; then
PATHDIR=`pwd`
else
PATHDIR=$1
fi
I’ve been getting strange messages in my system and console logs, or when executing certain applications from the command line. Notably iMovie and Skype:
iTeaHAL: Entering…
iTeaHAL: Not iTunes, exiting.
And when executing iTunes, I get this:
iTeaHAL: Entering…
iTeaHAL: Early startup…
itea_hijack_init: result: 0
iTeaHAL: Early startup done.
new_AudioDeviceAddIOProc:0×2281b68
link added
iTeaHAL: Late startup…
{length = 6, capacity = 6, bytes = 0×000a95c4a60e}
itea_fx_init: result: 0
itea_menu_init: [...]
The “which” Unix command lists the location of the first matching executable in your PATH. The GNU version of “which” has several extra features including the ability to display all matching executables in your PATH, not just the first. This is useful for finding duplicates, etc. Unfortunately, whatever version of “which” is included in Mac [...]