Category Archives: Software Development

Anything to do with web / software development

Pastebin on GitHub

OctocatI wrote the original pastebin.com, and sold the domain in 2010 in the wake of the Hotmail password leak.

I’m impressed with what Jeroen, the new owner, has done with the concept since then. However, his version was not open source, so I’ve kept my original version available for download, and I still get regular requests for it.

As I’ve had a request from someone wanting to fork it and make improvements, I’ve put it up on GitHub.

https://github.com/lordelph/pastebin

Frankly, the code is looking a bit dated and could use a bit of a spruce up. It would be nice to refactor into something more testable, as well as adopt PSR-2 compliance and make its dependancies use composer for installation.

But, it’s up there. Fork it and send me a pull request if you want to improve it yourself!

The Monty Hall Problem

goatI was a bit bored a few weekends ago, and happened to read a
BBC News article about the Monty Hall Problem.

Suppose you’re on a game show, and you’re given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what’s behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?” Is it to your advantage to switch your choice?

I’ve come across the problem before, but thought it might be fun to make a page which let you play the game and kept score. So here it is: montyhall.dixo.net

This started out as a little toy project to allow me to explore some areas of Symfony and Doctrine I’ve not used much. But, I’ve decided to get into the habit of polishing these little experiments and releasing them.

Give it a try!

Pepipopum – automatically translate PO files with Google Translate

Edit: Since I wrote this in 2009, Google have withdrawn free access to the translation API. I’ll leave this post up for anyone using the paid version though…

If you’ve ever worked on localizing an application or website, you may be familiar with the .po files used with GNU gettext and compatible tools.

I’ve written a script which can take a .po file and translate any untranslated strings with Google Translate. This may not be a ‘release quality’ translation, but does speed up the job of a real translator, who can simply proof read and correct the machine-translated entries.

See it in action here: http://pepipopum.dixo.net

I’ve released the source under the Affero GPL too, so you can tweak or host it yourself. The version hosted above does have a one second delay between translations, so if you want to go faster you’re encouraged to do exactly that!

Hope someone else finds it useful.