Archive for the ‘PHP’ Category

Professor von Explaino: Moo cards

Monday, July 27th, 2009

I was lucky enough to notice Moo when they did their first cross-promotion with LiveJournal, where you could get 10 free mini-moo cards, delivered anywhere.  Yes, even down here to Australia.  I put up a few of the photos I really liked and the resultant cards came out very nifty; everyone I showed them to agreed (maybe more of the concept than the shots ;) ).  With the steampunk picnic coming up, I thought now would be the perfect time to get a few quick cards thrown together for the Professor; and it would mean giving some money to the guys at Moo who I think deserve it.  Problem was coming up with a business card.

One idea I had knocking around in my head for a while was the Maze Generator I built a while ago.  This thing takes any dimensions and spits out a one-path maze for you, using an algorithm put on the web by J Kirwin (link now defunct).  Playing with the dimensions, I finally got a maze that would fit on a moo card – but it was still just a maze.  How to make it belong to Professor von Explaino?  The solution came in my site redesign, which Retro rocket had just finished.  Incalculatable wrangling had gone into the design work for the interrobang-cog that was the Professor’s signature emblem – mucking around further with PHP and I found a way to embed the logo behind the maze with just enough alpha-ing that the maze came through and the logo was still visible.

Just in time for the picnic!

Moocard


Working program driven enclosures in podcast feeds that iTunes will read.

Monday, September 11th, 2006

Problem

iTunes’ podcasting application refuses enclosures that do not end in an extension that it can recognise as an understandable file format. Example:

  • http://myhost/site/myfile.mp3 GOOD
  • http://myhost/site/myfile.php?file=141 BAD

So if you’re serving files from a database via an application, you’re out of luck no matter what headers you send.

Solution

Add a filename and additional question mark to the end of the URI:

  • http://myhost/site/myfile.php?file=141&filename.mp3?

This is made easier if your php file has the filename.mp3 as its GET parameter, as you just tack a ? on the end

(cross-posted from http://colinmorris.wordpress.com)