Pragmatism in the real world

Registering Doctrine Type Mappings for standalone migrations

Shortly after starting to use Doctrine Migrations as a standalone tool in my project, I came across this error message: Unknown database type bit requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it. This means that I have a column in my database of type bit which is used for booleans in SQL Server, but confuses the MySQL platform as it's not a default mapping. To support this, you need to modify the database connection's Platform object to… continue reading.

Routing specific traffic to the VPN on OS X

I have a client that requires me to use a VPN when connecting to their servers. I use OS X's built in L2TP VPN to connect, but don't want all my traffic going that way. To do this, I unchecked the Advanced VPN setting "Send all traffic over VPN connection" in the Network preferences and then created the file /etc/ppp/ip-up like this: sudo touch /etc/ppp/ip-up sudo chmod 755 /etc/ppp/ip-up The file itself is a bash… continue reading.

Using Doctrine Migrations as a standalone tool

My current project has reached the point where a good migrations system is required. As I'm targeting two different database engines (MySQL and MS SQL Server) and we're already using DBAL, it made sense to use Migrations from the Doctrine project. To do this, I updated my composer.json with the following require statements: "doctrine/migrations": "1.0.*@dev", "symfony/console": "~2.5" in order to install Migrations and also Symfony console component so that I can run it from the… continue reading.

Two incidents

An online friend of mine once said this about a sexism incident at a conference: "If I had been there, ZERO chance I would've sat idly by and let someone treat you like that" I like to believe that I have the same policy: If I am there when some casual sexism occurs, I will call it out. It turns out that this is untrue. One I have witnessed a number of incidents of sexism… continue reading.

Why I care about codes of conduct

tl;dr I want every conference to enthusiastically champion their code of conduct in order to publicly reassure attendees (women in particular) that any issues will be dealt with. I want all of us to actually notice jokes and conduct that make conferences uncomfortable for women and call out or report issues if we see them. I'm still learning how to do this, but the rest of this post goes into detail on why I think… continue reading.

Provisioning with Ansible within the Vagrant guest

I've been setting up a Vagrant VM for use with some client projects and picked Ansible to do this. Firstly, I played with the Ansible provisioner, but found it a little slow and then I realised that Ansible doesn't run on Windows. Rather than migrate what I'd done to Puppet, Evan recommended that I look into running Ansible on the guest instead and provided some hints. This turned out to be quite easy. These are… continue reading.

substr_in_array

No matter what I want to do with an array, PHP usually has a first class method that does it. I was therefore surprised that in_array() didn't handle substring matches. (I was sure there was a flag, but apparently not!) No doubt everyone has their own version of this, but here's mine so that I don't have to recreate it next time: /** * A version of in_array() that does a sub string match on… continue reading.

Setting up PHP & MySQL on OS X Yosemite

It's that time again; Apple has shipped a new version of OS X, 10.10 Yosemite. Apple ships PHP 5.5.14 with Yosemite and this is how to set it up from a clean install. However, if you don't want to use the built-in PHP or want to use version 5.6, then these are some alternatives: PHP 5.3/5.4/5.5 for OS X 10.6/10.7/10.8/10.9/10.10 as binary package by Liip Homebrew has PHP. Zend Server 7.x (Paid for) Let's get… continue reading.

Git push to multiple repositories

I have a couple of projects where I need to push to more than one repo all the time. I have been using this command line to do so: git push origin && git push other-remote However, I recently discovered that I can create a remote that points to more than one repository using these commands: git remote add all git@github.com:akrabat/projectname.git git remote set-url –add all ssh://example.com/path/to/projectname.git I now have a remote called all that… continue reading.

Kim

Today is Ada Lovelace day which celebrates the achievements of women in science, technology, engineering and maths. I have many role models in my technical life and many are women who inspire and encourage me to do better. There are too many to list, but I am thankful every one of them, both men and women. I want to talk today about one person who inspires me: Kim. Kim is relatively new to development. Fortunately… continue reading.