Pragmatism in the real world

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.

Jerry-rigging pygments to support new PHP keywords

I use rst2pdf to create my presentations and noticed that the syntax highlighter wasn't highlighting instanceof. rst2pdf uses pygments for syntax highlighting, so I wondered what was going on. A short investigation led to me realise that the current stable version of pigments is 1.6 and they are working on 2.0. It seems that 2.0 has a number of changes to the PHP lexer, which aren't in 1.6. While I'm waiting, I modified my local… continue reading.

Context specific history at the bash prompt

One change I made recently to my .profile is this: # up & down map to history search once a command has been started. bind '"\e[A":history-search-backward' bind '"\e[B":history-search-forward' These two bind command change the way that the up and down arrow keys work once you start typing a command to only search the history for lines that start with what you've typed so far. This means that I type, say, git and then press ↑… continue reading.

Alias for the PHP built-in server

I keep forgetting the correct command line syntax for the PHP build-in server, so I've now made an alias for it in my .profile: alias phps='php -S 0.0.0.0:8888' Now I can simply type: phps public/index.php to start the built-in web server.