Author Archives:
PHPUnconference Comes to Manchester
A great feature is the contributions and interests section – if there’s some content that would be particularly useful to you, or a talk you think would be a good fit, then you add it on this page. All the attendees can vote for which sessions we want to see and so we crowd-source the best lineup possible :)
If you fancy some more structured PHP training then hang around in Manchester after the event because thePHPcc are bringing their PHP Days training to Manchester on the Monday and Tuesday following the weekend event, which is pretty exciting :)
Hope to see you in Manchester, all I need to do now is work out which topics I want to see/give talks about …
3 Ways to Access a Namespaced PHP Class
Take this example (in a file called namespaced-class.php)
namespace Christmas\DaysOf;
class PartridgeInAPearTree{
}
Now we have a few ways to access that class.
Keynoting at PHPBenelux
I’ll be delivering a keynote at the PHPBenelux Conference in Antwerp in January alongside my good friend Ivo Jansch. Between us we’ve got plenty of stories to tell from our experiences in various areas of development and we’d like to share those with you! I hope you’ll come along and join us, and if you are quick you can catch the early bird prices, saving 50 euro.
On a personal note I have many great friends in this part of the world and I’m super-excited to know that I’m able to visit and see both the old friends I know well and the new friends I haven’t met yet. I attended this conference last year and it had a great atmosphere; this year the content is better again and with three tracks, I don’t know how we’ll choose which sessions to see!
Are you attending? Leave a comment and make sure to come and say hi at the conference in Belgium :)
Google Analytics Accounts API
Analytics Accounts
Your google account can have access to one or more analytics accounts. For example when I log in I have access to accounts which hold the data for lornajane.net, phpwomen.org, joind.in and a few other things I’m involved with. Only lornajane.net actually belongs to me, the others are accounts created by someone else and which I have access to. The first challenge therefore is to work out which a user has access to – the best place to start is the reference page for the Management API, part of google’s own documentation. In a nutshell, we build up a URL like this, being increasingly specific by fleshing out the values in square brackets on subsequent calls:
https://www.google.com/analytics/feeds/datasources/ga/accounts/[accountID]/
webproperties/[webPropertyID]/profiles/[profileID]/goals
First up then, is to get a list of accounts for our authorized user – I already have a valid oauth access token to use in this example Continue reading
360 Degree Feedback
Introduction to 360 Degree Feedback
The basic premise of 360 degree feedback is that rather than being given performance feedback at work solely by your superior, the feedback comes from people all around you. This would include your manager and your peers, but could also include your direct reports, and people that you work closely with from other areas of the business. For example a developer might receive feedback from the rest of the development team, the design lead, and the project manager.
256 Colours in Vim
Touring Colours in Vim
Please excuse the all-over-the-place spelling in this post, I’m British so “colour” is a word and “color” is a vim command. Confused? Me too
I grabbed two fantastic scripts – the Vim Color Sampler Pack and the rather awesome ScrollColors plugin which allows you to cycle through all your colorschemes and try them out.
Curl and Cookies
-c to Save a Cookie
Pass the -c switch followed by a filename and curl will write the cookies to a file. This is the “cookie jar” and you can dip into it whenever you want to send the cookies back with a future request. For example:
curl -c cookies.txt http://www.lornajane.net
This writes a file named cookies.txt to the local directory. When I look in it, it contains:
# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.
www.lornajane.net FALSE / FALSE 0 s9y_4e071c5ccc553288993faf0369cb076c 539e01676501366ea0f04e2646b1a31d
-b to Send Cookies
All I do when I want to use the cookie on future requests is pass exactly the same command but with a -b switch; this will read the named file and send the cookies along. You can edit the cookies as you wish, at your own risk of course, and this makes the use of cookies and curl an absolutely invaluable technique for testing! It’s also common to use it on sites where you want to download a file directly to the server but the site requires login first.
Business Strategies: Office Day
The idea of the office day is that I block out a whole day every month or so where I’m not going anywhere, not on site with clients, not speaking, not delivering anything, just in the office, doing whatever needs doing. I tend to put these days in either day before or after runs of days away – either with clients or at events, just to give me time to catch my breath. Working this way means that when I’m working on something, I can just work on it, and know that there is time set aside for all the little things. Also the days where I’m just back from somewhere and the inbox is so full, it is ready to bite, then it gives time to get things straightened out and right, without feeling stressed because there is other work to do. Although it does mean that I’m not doing billable work that day, I find that splitting the work up like this works really well for me, and I thought I’d share – perhaps this suggestion will help someone else, and I’m always interested to hear how others fit in all the business bits and pieces around their “real” work.
Fetching Namespaced XML Elements With SimpleXML
I was reading from their analytics data feed API, this returns a few key fields and then multiple <entry> tags, each with namespaced children. The entry tags look something like: Continue reading