- Most of us who have converted from Windows to Mac hate the Mac’s usage of the Home and End keys (move to beginning of file or end of file, respectively.) Here’s a trick to ‘fix’ them:
To make home and end keys work on a mac simply copy this into the specified file (DefaultKeyBinding.dict)
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
"^f" = "moveWordForward:"; /* Ctrl-f = next word */
"^b" = "moveWordBackward:"; /* Ctrl-b = previous word */
"^v" = "pageUp:"; /* Ctrl-v = page up */
"UF729" = "moveToBeginningOfLine:"; /* Home = start of line */
"$UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift-Home = start of doc */
"^UF729" = "moveToBeginningOfDocument:"; /* Ctrl-Home = start of line and select */
"@UF729" = "moveToBeginningOfDocument:"; /* Cmd-Home = staart of doc */
"UF72B" = "moveToEndOfLine:"; /* End = end of line */
"$UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift-End = end of line and select */
"^UF72B" = "moveToEndOfDocument:"; /* Ctrl-End = end of doc */
"@UF72B" = "moveToEndOfDocument:"; /* Cmd-End = end of doc */
Everything seems to work except firefox, sadly.
- We’re looking for the best search plugins for Trac. Suggestions?
- Rails: We often find ourselves adding
and return in our Controllers to avoid the dreaded
DoubleRenderError. It turns out that you can use
unless performed? instead:
render :template => "wrangler/monkey" if wrangle_monkey?
render :template => "wrangler/sleep" unless performed?
- Rails gotcha: with ActiveRecord.findXXX, you can specify query parameters such as
:include. But if you use those three together Rails will generate an incorrect query.
- Rspec 1.0 has been released.
Ask for Help
- Yahoo’s Geolocation service is broken after they released a new version if their code. Zip code searching in particular significantly broken — discussion thread here: http://tech.groups.yahoo.com/group/yws-maps/message/5468 — here is an example:
- Search for a zip code using the following URL: http://local.yahooapis.com/MapsService/V1/geocode?appid=YahooDemo&location=94102
- Result (notice the bad State and Zip tags):
<ResultSet xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:maps"
<City>San Francisco, CA 94102
<!-- ws05.search.re2.yahoo.com compressed/chunked Thu May 17 15:02:00 PDT 2007 -->
This is fixed! Thanks, Yahoo!
If you are missing the Rspec gem, you specs will fail silently. It’s a good way waste a few hours trying to figure out what’s wrong.