My Winter Wedding

Although I usually write only about technology on this blog, it’s still a personal site and I have some news that I absolutely must share: I got married!!!! I’ve been waiting for the official photos before I wrote this post (“pics or it didn’t happen”, as the saying goes) so here is the evidence:

On the stairs
Continue reading

Google OAuth 403 Response

I had an issue this week on a system which has been working fine for a while, but stopped fetching some data from google’s user account API. I was getting a 403 response from the API, which seemed odd. Luckily I was logging OAuth::getLastResponse() to my error logs (this is PHP code, and you need to call OAuth::enableDebug() before you make the request to get this output) so I could see that I was getting the following back from Google:



  
    GData
    sslRequired
    SSL is required to perform this operation.
  

Closer inspection shows that for one of the google endpoints, I had a prefix of http:// rather than https://. Those single-character bug fixes that take hours to find are my favourite!

Speaking at DayCamp for Developers

I am delighted to announce that I’m speaking at the upcoming DayCamp for Developers in early March. The idea behind the daycamps is to bring important but non-technical skills to developers everywhere – so the sessions are virtual and so are the speakers! This time around the topic is Business, so we have a series of speakers to give you advice from a practical, developer-centric point of view – on everything you need to know!

My own talk is “Time and Money”; both are pretty important concepts to have a handle on when you are in business, either as a freelancer or when starting or helping to start a bigger business. Even as an employee, these are really important concepts to understand; most of what I learned about business I learned working with business people in the jobs I had beforehand.

Time is important because we need to figure out how much we have and how to share it around. Money is important because we all like to get paid. I’ll be sharing my own tactics for keeping both of them under control so I hope you’ll join us!

Mercurial “Not At A Branch Head” Error

Although I write and speak a lot about various kinds of source control (git and subversion are the most popular still as far as I can see), my own development projects are on BitBucket under mercurial (bitbucket also offer git hosting these days, and their tools are great). Recently I was working on an upgrade for BiteStats (note shiny new theme, with thanks to @miss_jwo) and I kept getting this error from hg tag

not at a branch head
Continue reading

Building a RESTful PHP Server: Output Handlers

This is the third installment in my series about writing a RESTful web service in PHP (the previous entries are about understanding the request and routing it. It is probably the last one but there are a few other things I’d like to cover such as error handling, so I might keep adding to it, especially if I get any particular requests or interesting questions in the comments. So far we’ve covered parsing requests to determine exactly what the user is asking for, and also looked at routing to a controller to obtain the data or perform the action required. This post gives examples of how to return the data to the client in a good way. Continue reading

PHP 5.4 Built In Webserver

One of the big features arriving with PHP 5.4 is the addition of a built-in basic webserver for use in development environments. Quite a few of the other scripting languages have something like this so I’m very pleased to see it in PHP. Using a server like this makes it easy to quickly try out some scripts without needing to configure apache or really do anything much! I had to look up a few things to get started, so I thought I’d write them down for posterity. Continue reading

Building A RESTful PHP Server: Understanding the Request

Once upon a time, what seems like a lifetime ago, I was away for a couple of weeks, and I wrote a series of posts about serving RESTful APIs from PHP to keep my blog going while I was away. Fast forward a few years and those posts are outdated and still wildly popular – so I thought it was about time I revisited this and showed how I’m writing RESTful PHP servers today!

In the first part of this (probably) 3-part series, we’ll begin with the basics. It might seem boring, but the most important thing to get right with REST is parsing all the various elements of the HTTP request and responding accordingly. I’ve put in code samples from from a small-scale toy project I created to make me think about the steps involved (should I put the code somewhere so you can see it? Let me know). Without further ado, let’s dive in and begin by sending all requests through one bootstrap script: Continue reading

Which Basket Should A Developer Put Their Eggs In?

The situation goes like this. Lots of excellent, capable people have great ideas for new software products. They are bootstrapping their venture, so they look for a developer who wants to give some time up front and receive a fair (let’s assume fair) share of the rewards once the product becomes successful.

The question is: as a developer, how do you know which of these products (I get about one tempting enquiry a month from what sounds like a real person who isn’t building a social network) is a good bet?