Monday, March 31, 2008

Single window mode in Safari

Another hidden preference...
# defaults write com.apple.Safari \
TargetedClicksCreateTabs -bool true

Friday, March 28, 2008

Right click on a mac laptop

I've been using control+click for right click for ages on my macbook and I have complained about the lack of a control key on the right side of the space bar. But now I just found out that there is an option in System Preferences under Keyboard & Mouse that allows you to right click by putting two fingers on the trackpad. See the screenshot.



This is just way better than control+click!

Wednesday, March 5, 2008

Collect all open windows to one space

I love using Space, especially after replacing an aging 15" PowerBook (more than 4 years old) with a brand new MacBook with a relatively small 13" screen.  However, sometimes I found my application windows are all over the four spaces I opened and I need a quick way to move them into one space.

Here is the trick: Enter space, press c, all windows will be collected into the first space.  Press shift+c to watch the slow motion.  Enjoy!

Monday, March 3, 2008

Several Mac OS X tips

1. Getting tired of the default background of login window? You can change it by
# sudo defaults write \
/Library/Preferences/com.apple.loginwindow \
DesktopPicture '/Path/To/Your/Picture'

2. Set default path for every application in Mac OS X:
# mkdir ~/.MacOSX
# defaults write ~/.MacOSX/environment "PATH"  $PATH

Log out then log in and you are all set. You can also use this method for other shell variables.

3. When you use spotlight to search content of PDF files, clicking on the result will bring up Preview.app, showing the highlighted text at a very large scale, effectively rendering this feature useless. To change it,
# defaults write com.apple.Preview Preview \
-dict-add PVPDFSpotlightSelectionSize 1

Sunday, March 2, 2008

Display several plots together in Mathematica

In Mathematica one can display several plots together using the following command. Let's first generate two plots, for example,
g1 = Plot[Sin[x], {x,0,2Pi}];
g2 = Plot[Cos[x], {x,0,2Pi}];

One can then choose to show these two plots in the same graph:
Show[g1,g2]

or display them in an array:
Show[GraphicsArray[{g1,g2}]]

It is generally a good idea to assign a variable to each plot so later it can be used without regenerating the plot.