Displaying MySQL query results vertically

Ever found the MySQL table view annoying? The table format is terrible at displaying rows with long values, isn’t it? You can get MySQL to display results vertically:

Some query results are much more readable when displayed vertically, instead of in the usual horizontal table format. Queries can be displayed vertically by terminating the query with \G instead of a semicolon.

More information on this tips page.

mysql> select * from wp_usermeta where user_id in ( select ID from wp_users where user_login = 'ab04d41a-f5b3-4859-9474-5a7047c7e23c' )\G
*************************** 1. row ***************************
  umeta_id: 325
   user_id: 24
  meta_key: nickname
meta_value: Mr G Teacher
*************************** 2. row ***************************
  umeta_id: 326
   user_id: 24
  meta_key: rich_editing
meta_value: true
*************************** 3. row ***************************
  umeta_id: 327
   user_id: 24
  meta_key: comment_shortcuts
meta_value: false
*************************** 4. row ***************************
Isofix bar for Ford Focus

Fitting Isofix in a Ford Focus MkII

The tricky bit was removing the rear seat, mainly because I was looking at the instructions for the wrong model of car; the right instructions for me were on the Focus Fanatics forums. Fitting the actual bar itself was comparatively easy, just two bolts (after you’ve removed the bungs from the bolt holes), I’ve written a StackExchange answer. I bought the Isofix bracket and Torx driver set from Amazon.

DIGITAL CAMERA

I had a dream

The first post in a series covering how we currently control our development environments at Code For The People.

Back in 2013 I had a dream. I wanted our team at Code For The People to work within a consistent development environment, which we could jointly outfit with tools and functionality to help us do our job better. I wanted us to be able to assemble resources, plugins and themes and code libraries, as we needed them. I wanted us to be able to easily develop and easily deploy. I wanted something which would allow us to engage freelancers, or even clients, and get them started on development without having to go through complex sysadmin procedures. I wanted us to be able to jump in and help each other at short notice.

I think we’re well on the road to meeting these requirements now, and so I’m due to write up the travails which have got us to this point. Continue reading

Against the flow

Testing HTTP redirects with Curl

We’ve got a really complex redirection setup for the current project at work, a mix of some general rules (http://blog.example.com/ to http://www.example.com/blog/), some oddball domain redirects (http://blog.example.jp/ to http://www.example.co.jp/blog/), and some more esoteric ones thrown in there for luck. I started off briefing my colleague with a description of what I needed, but this very quickly became too complex and I realised I really needed to give him a set of initial URLs and expected results. Why not express these rules in a quick test script? My colleague could run the script against the redirects as he wrote them, and see the successful ones and the failures, along with detail about why they failed. Continue reading