Last weekend I wrote about a workflow for fixing telephone numbers that I came up with that leveraged TextExpander’s ability to run shell scripts. I’ve been thinking about using TextExpander to manipulate the clipboard, and far too late in the evening I came up with another application of that technique. This time, what we’re going to do is use TextExpander and another script to turn titles into file names for blog posts, specifically for Jekyll style blogs (Yes, I know there is a rake command to do this already, but I tend to start typing in a text editor, not in a terminal window).
Welcome back to another post in my “Automating For The Sake of Automating” series. In this post, I’m going to show you how to use TextExpander to fix up the formatting of phone numbers in a text document. What this does is transforms a phone number on the clipboard to a standard format. Here is the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Paste this into a TextExpander snippet set to “Shell Script”, pick your abbreviation, and standardize away.
Check out Technical Difficulties Episode 63 if you’re interested in learning the fundamentals of responsive web design. Erik does a great job explaining to Gabe and the listeners how HTML and CSS are used to build a web site that looks good on everything from an iPhone screen to a 27 inch iMac. The companion tutorial is clear and easy to understand as well, and has sections of the podcast embedded into it to follow along.
If you jump back and forth between Finder and Terminal a lot, this may be handy. In OS X Lion Apple included a Service that allows you to open a new Terminal window or tab at for the folder you are looking at in the Finder. To enable this service, open System Preferences → Keyboard, click on the Shortcuts tab, then select Services from the table on the left. Scroll the right hand outline down to Files and Folders and check the appropriate boxes. Now when you’re navigating around in Finder, to jump over to Terminal simply right click on the desired folder and select Open In Terminal from the Services menu.
Back in 2010 a Parisian apartment on the Right Bank, near the Opéra Garnier, left unoccupied since 1942 was discovered.
It was owned by Madame de Florian – a socialite and an actress – who fled to the South of France during the second world war, leaving everything behind. She never came back to Paris but kept on paying her rent until the day she died when she was 91.
If I had the means, I’d move in there in a heartbeat.
When you’re dragging windows to resize them on your Mac, holding down the option key will resize the widnow symmetrically, i.e. shrink the window from both sides and top if you drag diagonally. If you hold down shift while dragging, the window will resize while maintaining the current aspect ratio. This works in OS X Mavericks and Mountain Lion.
This is confused me for a while. Granted, finding the answer wasn’t high on my list of life needs, but I did happen to stumble across this article by Josh Staiger that explains which one you should use for terminal customization and why.
TLDR; Edit .bash_profile on a Mac and .bashrc on Linux.
I was setting up a test scenario tonight to figure out how to subclass NSTableCellView. It turns out you can, pretty much the same way you subclass everything else in Objective-C, by making a custom class and twiddling the settings in Interface Builder until it does what you want. The interesting side problem I ran into tonight was creating a collection of
NSDictionary objects holding an arbitrary number of
NSStrings pulled from another array. Basically, what I wanted to do was read in the
/usr/share/dict/propernames file, assign the first three names to a dictionary, then create another dictionary, assign the next three names to that one and so on. The first order of business was to populate a storage array with a list of names, like so:
1 2 3 4 5
There are a few different ways to enumerate an array in Objective-C. My usual go-to for enumerating arrays is Fast Enumeration, i.e. the for/in form, but it lacks the exposed index variable that I thought I would need. If at this point, you’re wondering what I’m on about, I would encourage you to read this post by Mattt Thompson (that’s the way he spells it) over at NSHipster. My next thought was to use a simple
for loop and the ever so handy modulo operator like this:
Shortly before the holidays I took advantage of a sale at $2 tuesday to check out Forklift 2 from BinaryNights. The last FTP client I played with was Cyberduck and to me, it just didn’t feel quite right. Forklift 2, on the other hand, is very much a Mac app in it’s look and feel. Forklift 2 allows me to work with the Vegans With Typewriters server like I would any other mounted volume on my Mac. As of December 27, 2013, Forklift 2 is available in the Mac App Store for $1.99, which is a deal that can’t be beat. If you’re still unsure, check out this video tutorial by Don McAllister that covers the basic features of Forklift2.