Jun 19
2010
Just a quick hit on this one… when hacking away at the styles of things one probably shouldn’t be hacking away at, embedding images right in the CSS is a handy trick. It’s done by Base64 encoding the image, removing line breaks from the resulting string, and using it to set the background property for the CSS rule.
It looks something like this (truncated):
[…]
The image/png changes depending on the filetype that’s encoded, becoming image/jpg or image/gif, etc…
Apr 28
2010
I’m fascinated by http://to. It’s a url shortener with no TLD. Some browsers, and apparently some DNS setups, don’t like the urls it creates (they want a .com or .org or anything at the end), so it’s not exactly in heavy usage. Still, I wish they had an API. In lieu of that, here’s a quick Ruby script that will run on a stock OS X install as a System Service. It’s so simple that I’m not even going to package it up… It’ll be a good chance to show the steps for creating your own utilities using Snow Leopard Services:
require 'net/http' require 'cgi'input = STDIN.read http = Net::HTTP.new('to.')
Mar 06
2010
Just a quick change to my post on the bash function […] that I’ve been using. A small modification has greatly improved its usability: make the cancel option always be first in the menu. Just move “Cancel” before the […] bit. It’s a little odd that I didn’t do that to begin with…
fp () { #find and list processes matching a case-insensitive partial-match string ps Ao pid,comm|awk '{match($0,/[^\/]+$/); print substr($0,RSTART,RLENGTH…