Dec. 21, 2011

IMG_20111211_182613.jpg IMG_20111211_182346.jpg IMG_20111211_182752.jpg

A piece of the world I really enjoy.

Dec. 17, 2011

Sometimes you want to test a bit of PHP code on your local machine without installing a full LAMP stack. Mongoose is a web server that will let you do that.

Under Ubuntu I first downloaded and installed the mongoose source code, then I installed the package php-cgi and here is the script called phpserve that I use to launch Mongoose in the top level directory of my PHP project:

#!/bin/bash
mongoose -e error.log -r `pwd` -i index.php -p 8000 -C .php -I /usr/bin/php-cgi

After that you can browse to http://localhost:8000/ and you should see your site.

Enjoy!

Dec. 7, 2011

mccormick-family-portrait-tallulah-birthday.jpg

Photo by Renee Glastonbury. Altered to obscure one nipple. :)

Dec. 2, 2011

If you visit my website you will notice everything is in a scrawly hand-written font now. This is a digitized version of my own handwriting. Here is how I produced it:

  • Went to YourFonts and printed the templates twice.
  • Scanned both copies, used the best version of each letter, and tweaked some stuff in an image editor.
  • Uploaded the templates, paid $15, and downloaded the resulting TTF file.
  • Tested it out on my blog (see the cross-browser CSS font-face declaration below).
  • Loaded up the TTF in font forge and tweaked more stuff.

To get it as a web useable font:

  • Use a program called ttf2eot to create a web font file that Internet Explorer likes.
  • Use the following CSS font-face declaration, which works on pretty much all mainstream browsers including Internet Explorer 6.

Font-face declaration:

@font-face {
    font-family: 'MyFont'; /* Use the real name of your actual font */
    src: url('MyFont.eot');
    src: url('MyFont.eot?#iefix') format('embedded-opentype'),
    url('MyFont.ttf') format('truetype');
}

You can do this with basically any TTF font, but watch out for the legal implications of using commercial fonts on the web. It's obviously fine to do it with a font of your own handwriting. There are probably lots of other free fonts you can do it with too, but read the licensing information first.

Here's to more flexible web typography!

Dec. 1, 2011

Looking for a good open source Software Libre alternative to Google Analytics? I can't recommend Piwik highly enough.

Piwik graph example

  • Setup was easy - PHP & MySQL with a simple web based installer.
  • Basic mechanism is similar to G.A. - add a code snippet to the bottom of your HTML code and you are done.
  • Reporting seems more comprehensive than G.A. - all kinds of interesting data, visitor trails, etc.
  • Take back ownership of your stats data!

Have fun.