Useful keybindings


Following are some keybindings that are really useful if you spend large portions of your day in some kind of texteditor. These are available in each and every Cocoa-app (read: almost every current mac app). If you want to know more about the Cocoa Keybindings go here.

If you’re a touch typist, if not read this: Programming’s Dirtiest Little Secret , learn to type, then come back and read on, their usefulness doubles increases if you remap your capslock key to function as the control-key (System Preferences -> Keyboard & Mouse -> Keyboard -> Modifier Keys). Now your fingers remain on the home row and you won’t develop an emacs-pinky.

Update

Try to avoid using the arrow keys at all times, they make your hands leave the home row. Just try it for a week, if it doesn’t work for you, annoy me on twitter.

Navigating text


        C-P
C-A C-B     C-F C-E
        C-N

A: as in the beginning of the line
B: as in Backward one character
P: as in Previous line
F: as in Forward one character
E: as in the End of the line
N: as in Next line

Killing/Deleting text

C-D : Forward Delete
C-H : Backward Delete
C-K : Kill line (Deletes to the end of the line)
C-O : Splits the current line (Opens a line)

“There are basically two types of people. People who accomplish things, and people who claim to have accomplished things. The first group is less crowded.”

Mark Twain
“Illtyperacy is the bastard incest child hiding in the industry’s basement”

“Specialization is for insects.”

Robert A. Heinlein (HT @netlash)
“There are two types of people—those who come into a room and say, ‘Well, here I am!’ and those who come in and say, ‘Ah, there you are.’”

Frederick L Collins

Nice guys finish last, but we get to sleep in.


Prelude

If, like me, you get your TV fix via the intertubes (aka the-not-entirely-legal-but-the-way-it-should-be) you’ll encounter the .rar-fileformat. Nothing special about rars, they’re like zips but better, they compress to smaller files and take less time doing so. I mostly do my unrarring in batch (aka I’ve downloaded the episodes of a new season and want to unpack all of them). And so we come to the problem: this makes my macbook stutter.

Overture

What causes stuttering ? Either the CPU (think of Flash as an example) is being used intensively or the IO (think of copying multiple files at the same time) is doing too much. So I googled this and like most of my google searches nowadays, I already knew the answer.

Back when I was still an avid SETI-user, it was a cool screensaver at the time and the concept (cloud computing using the internet) was still is great, I used nice to make SETI not clobber the CPU.

Main theme

Nice allows you to alter the priority of an application, this is probably an oversimplification but it fits our purposes. Now to bring the prelude and overture together:

nice -n 15 unrar e The.Sopr.Errr.Show.That.May.Not.Be.Named.part1.rar

Now unrar will assign itself almost the lowest priority (20 is the lowest, -20 is the highest) and you can enjoy stutterfree computing while unrar chucks along.

Notes

  • I don’t really remember where I got the unrar binary from, but you (probably) could extract it from UnrarX.app
  • Do this :

    nice -n 20 ./Applications/Safari.app/Contents/MacOS/Safari

    Then go to a Flash site and watch it stutter

  • My next post will be about screen, a real gem to know.

iPhone on a 24" screen


I’m guessing what they’re doing is:

  • Make the iPhone do video-out (look here )
  • Fake all the interactions with the iPhone offscreen

I would <3 to be proven wrong.

“Do not worry about people stealing an idea. If it is original you will have to ram it down their throats.”

Howard Aiken