Pragmatism in the real world

Setting up PHP & MySQL on OS X Mavericks

With OS X 10.9 Mavericks, Apple chose to ship PHP 5.4.17. This is how to set it up from a clean install of Mavericks. Note: If you don't want to use the built-in PHP or want to use version 5.5, then these are some alternatives: PHP 5.3/5.4/5.5 for OS X 10.6/10.7/10.8/10.9 as binary package by Liip Zend Server (Free Edition) Homebrew has PHP. Let's go!

Changing the GitHub IRC hooks notification events

As joind.in uses GitHub to host its source code, we use the IRC hook to receive notifications to the IRC channel (#joind.in on freenode) when interesting things happen on the GitHub repositories. We noticed recently that we were being notified about more types of things happening on some repositories compared to others, so I decided to investigate. The code for this is here and a quick perusal of it shows that it will do something… continue reading.

rst2html does not support :startinline:

I'm currently writing some documentation in Restructured Text that I'm targeting at HTML and PDF using rst2html and rst2pdf. For syntax highlighting, both rst2html and rst2pdf use Pygments, however rst2html doesn't support any Pygments options. So a typical PHP snippet in rst targeting rst2pdf, would be written as: .. code-block: php :startinline: true $this = str_replace('foo', 'bar', $that); The startinline Pygments option is to allow it to highlight the snippet, even though the opening <?php… continue reading.

Some notes on git

This set of notes covers the main things that I think you need to know about working with git. It is not comprehensive and mainly serves as a reminder for myself. Remotes In a typical open source workflow using GitHub or BitBucket, you would fork the main repository into your own and then clone that copy to your local computer: git clone git@github.com:akrabat/joind.in.git You then need to connect your local repository to the main repository.… continue reading.

Git export from BitBucket

One of the consequences of moving to git is that I needed to get our deployment scripts working with it. The first requirement was an equivalent to svn export. This is simple enough, but, as usual, I wanted to save myself some effort and created a script that wrapped it up for me. git-export.sh: #!/bin/sh # # USAGE: export.sh REPO_NAME BRANCH_NAME [DIRECTORY_NAME] [BITBUCKET_ACCOUNT_NAME] # # BITBUCKET_ACCOUNT_NAME=akrabat GITROOT=git@bitbucket.org:${BITBUCKET_ACCOUNT_NAME} if [ -z "$1" ]; then echo "Usage… continue reading.

Migrating to BitBucket from Subversion

I've recently started the process of moving all of my Subversion repositories to BitBucket. BitBucket is my preferred git hosting supplier as its pricing structure suits me much better; that is, I have lots of private repositories and GitHub is too expensive for my case! As I needed to migrate over one hundred repositories from Subversion to BitBucket, I automated it via a simple shell script. Rather usefully, BitBucket has an API that let me… continue reading.

Preparing for the ZF2 Tutorial at PHPNW12

If you are coming to the ZF2 tutorial at PHPNW12, then you will get the best out of it if you do a little preparation before you arrive. Laptop You should bring a laptop with the following working on it: A web server (preferably Apache) running PHP 5.3.3 or higher A working MySQL server along with an administration tool such as phpMyAdmin A text editor or IDE that you're comfortable coding with Vhost set up… continue reading.

Introducing Avalance: A landslide presentations theme

Evan and I are giving a joint Zend Framework 2 tutorial at the PHPNW12 and ZendCon conferences this year and, consequently, we needed a way to create the presentation collaboratively, ideally using a text based system which we could store in git. There are plenty of HTML5/JS based solutions out there and we decided on landslide which is a python based markdown -> HTML presentation system. However, I really didn't like any of the default… continue reading.

Setting up PHP & MySQL on OS X 10.8 Mountain Lion

There is a Serbo-Croatian translation of this article kindly provided by Anja Skrba: Podešavanje PHP i MySQL na OS X 10.8 With OS X 10.8, Apple continues to ship PHP 5.3 with Xdebug, PEAR, GD and PDO_MYSQL. This is how to set it up from a clean install of 10.8. /usr/local Ensure that the following directories exist: sudo mkdir /usr/local/include sudo mkdir /usr/local/bin sudo mkdir /usr/local/lib sudo mkdir -p /usr/local/man/man1 MySQL Download the "x86, 64bit"… continue reading.

Automatic Apache vhosts

One thing that I've wanted to implement for a while now is automatic vhosts on my dev box. The idea is that I want to drop a folder into a directory and have it automatically turned into a vhost for me accessible at http://foldername.dev. It turns out that this isn't nearly as hard as expected which is usually the case with things that I've been putting off! This is how to do it. Apache configuration… continue reading.