Wishful Coding

Didn't you ever wish your
computer understood you?

Search Google in running browser

After reading this hint, I wanted to get it working with my previous script to open links in the currently running browser.

I did not use OnMyCommand, but instead just made an Automator service. Here is how:

  • Open Automator and create a service
  • Set the type to text
  • Add the ‘Run shell script’ action
  • Set the shell to Python and the input to ‘as arguments’
  • Paste the script below

The script(this text serves only to satisfy Posterous’s parsing engine, which is seriously pissing me off):

import sys
import urllib
import webbrowser
webbrowser.open("http://www.google.nl/search?q=" + urllib.quote(sys.argv[1]))

Automator

You need to have my previous script installed to do the actual opening of the url. With some more trickery, it is even possible to add this service as a keyboard shortcut. I suggest you Google around a bit, and comment if you find something revolutionary.

JS server benchmark: Node.js & Rhino; Part 2

After having tested the pure JS speed of Node and Rhino in my previous post, I wanted to see some actual numbers for serving stuff.

Long story short, I grabbed the "Hello world!" examples from both Node.js and Rhino running on Jetty and ran 'ab' on them.

I was not able to do high-concurrency tests on my Mac, because Jetty gave up around 100, and Node somewhere around 200. I think I'm having the issue described here.

So here is the graph. I don't have much experience with benchmarking, but again, it is obvious that Node.js is in fact quite a lot faster than the Rhino/Jetty combo.

JS server benchmark: Node.js & Rhino; Part 2
Published on

Remove the bookmark button in Safari

A while back I found this comic, comparing Safari with a bike, and Firefox with a car with a lot of stuff attached to it.

Remove the bookmark button in Safari

But in reality, since Safari 5 supports extensions, it starts to look more and more like this illustration from a Dutch children book.

Remove the bookmark button in Safari

Now that I have lots of goodies and a nice Delicious bookmark button, I wanted to get rid of the bookmark button embedded in the navigation bar. This video shows how to do it.

[[posterous-content:XUORk3FShLrdFY9GRo7d]]

If someone knows how to embed the Delicious button in the navigation bar, I would be very pleased.

Published on