Example composer.json for SVN repos with no structure and no composer.json

Today I needed to include some WordPress.com themes from the official SVN repository, using Composer. This repository uses SVN and has not got the usual trunk, branches, etc directories that Composer expects, which makes it tricky. It’s possible though, and thanks to colleague Tom Nowell, I eventually got there.

Here’s that example code: Continue reading Example composer.json for SVN repos with no structure and no composer.json

Podcast – How Google uses behavioral science to make work suck less

Podcast: How Google uses behavioral science to make work suck less

This episode of the You Are Not So Smart podcast came recommended by Donncha, a colleague at Automattic. It’s packed full of really interesting thoughts, including “the job of a manager is to serve their team”; a good reminder that everything we at WordPress.com VIP do in terms of process does serve our team and our goals.

Laszlo Bock (head of People Operations at Google) explains how and why Google does what it does when it comes to everything internal, from perks and promoting to motivation and productivity. In the interview you’ll hear how the company combats confirmation bias, the halo effect, the Abilene paradox, pluralistic ignorance, survivorship bias, and more – all with a mix of behavioral science and Google’s immense power to test and re-test using its unique resources.

If Tom Willmot’s WordCamp Europe talk was out on video, I’d link to that, so keep your eyes open there. There’s also Nikolay’s tweet recommending Drive, which is now on my reading list:

…of course, if your work sucks, you could change that by coming to work for Automattic ;)

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 ***************************

Protecting staging sites with Basic Authentication

This approach was primarily devised for use with WP Engine staging sites, but will work in any situation where you have no access to Apache’s config and need to use a single .htaccess file for multiple domains (e.g. a multisite setup).

We’ve recently had a couple of projects hosted on WPEngine where we need to have a staging site protected by Basic Authentication so only authorised users can access it. Normally I would configure Basic Authentication in the Apache VirtualHost, but on WP Engine (for example) they handle all the server configuration for us, meaning we don’t have access to the Apache configuration. WPEngine also provide a Git push to deploy facility, which we tend to take advantage of because Version Control Rools, OK? Because all the web files are within Git version control, we are using the same .htaccess file for the developer, staging and live sites. (We could Git ignore the .htacess file, but I prefer to version control more, rather than less.)

Continue reading Protecting staging sites with Basic Authentication