Oct 31, 2013

Three useful Subversion commands

If you still use Subversion, you may want to know these three commands:

svn diff -c revision

This will show you modifications made in the particular revision.

svn diff -c revision --summarize

This will show you what files were modified in the revision but not the content of the change. Useful if you just need a list of files.

svn merge -c revision source_url wc_path

This will make a "cherry-pick" (hello, Git users!): pick up the content of that revision and merge only it into your working copy.

Oct 30, 2013

OS X lid sleep and Google Chrome

Found a problem on Mountain Lion & Mavericks: if you use Google Chrome, you may experience Macbook Pro sleep issues when closing the lid. It may take several minutes until MacBook goes to sleep. Testing if the issue exists is easy: just keep Chrome running (preferably with heavy content, like YouTube) and close the lid. If the sleep indicator does not start to "breath" in 2-3 seconds, you have the issue. Open it, quit Chrome and try again. You will see that MacBook goes to sleep much faster. Apple Safari has no such issue.

Why this can be a problem for you? Because when you are on the move, you need every bit of power you can scrap from the battery. Even though OS X Mavericks increased battery life for me from 4h to 6.5h, I still prefer to save all the power that my battery has.

So I migrated from Safari. Incidentally, it is faster than Chrome in Mavericks.

Oct 27, 2013

Assigning a backtick key as a shortcut to the Safari Reader

Safari includes a nice feature called "Reader". This is a feature very similar to what Readability extension in Google Chrome do: it takes the main content of the page and presents it for easier reading by stripping all other elements of the web site and changing the font to a big nice and easily readable.

All is good but Google Chrome uses a back tick key for invoking Readability while Safari uses Command+Shift+R, which is much less convenient (try that on your keyboard!). Normally you can change this in the OS X Keyboard settings. The problem is: that panel accepts only keys with modifiers (you cannot have anything without a Command, or Alt, to Control). So how to add a back tick there?

Terminal comes to help (this is one line below!):

defaults write com.apple.Safari NSUserKeyEquivalents -dict-add "Show Reader" "\`"

This command will set the back tick as a reader invoker. Back slash is needed there, it escapes the back tick for the Terminal and will not be a part of the final key sequence.