Wishful Coding

Didn't you ever wish your
computer understood you?

A smile for web standards

We all love web standards. While I was implementing a little easter egg(which are also very lovable) on http://coverontwerp.nl/ with a good deal of CSS3 love, I thought it would be nice to turn as many clicks as possible into a smile for web standards, a mini ACID test if you will.

Bellow you'll find a CSS snippet that, when included on your site, will flash a smile for every link clicked in a supporting browser.  It is totally unobtrusive, and only blinks the moment anyone clicks a link, thus spreading some positive feelings to all supporters of web standards.

Example implementations can be found here and on http://coverontwerp.nl/. Show some standards love, by including the snippet below on your site!

a:active:after {
	display: inline-block;
	margin-left: 5px;
	font-weight: bold;
	content: ":)";
	-webkit-transform: rotate(90deg); 
	-moz-transform: rotate(90deg);
	-o-transform: rotate(90deg);
}

Other selectors, styling and ASCII arts are encouraged!

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