Developers – do yourselves a favour and turn off smart-quotes

Ocassionally I write commands in my notes app before copying and pasting them into iTerm.  It’s very easy to type “regular quotes” and not notice macOS has converted them into “smart quotes”.

Then your command doesn’t run, and you get an error message that doesn’t make any sense because the arguments aren’t being parsed correctly, but you don’t notice at first it’s the quotes that are wrong because the font is too small and your mind is fixated on looking for spelling mistakes and syntax problems…

To turn them off, on a Mac go to:

System Preferences > Keyboard > Text > uncheck “Use smart quotes and dashes”

iOS 10 tips

Updated Fri 7 Oct 2016 with note about Emergency Bypass

  • Avoiding having to manually click/press the home button to unlock the phone when you are viewing the notifications screen (there isn’t any benefit to this on iPhone 6 or 6s).  Go to: Settings > Accessibility > Home Button > turn on “Rest finger to open”.The caption on the lock screen will still read says “Press home to open”, but you only need rest your finger on the TouchID sensor. Note this option is only available if the device has TouchID – if you don’t have a fingerprint sensor, you must click the (mechanical) button manually.
  • (not new to iOS 10) – if you are fed up of accidentally bringing up the Apply Pay / wallet screen because you clicked the home button twice by mistake when the display was off, go to Settings > Apple Pay and Wallet and turn “Double-Click Home Button” off – with this, double clicks will just wake/unlock the phone instead.
  • There’s a new Emergency Bypass setting in contacts.  You can set it separately for ringtones and texts and it’s described as allowing “sounds and vibrations from this person even when Do Not Disturb is on.”Be aware, however, it means your iPhone will sound for that person regardless of the position of the Ring/Silent switch – this may mean you don’t want to use it after all, if you want to guarantee your device will be silent when the switch is set to silent.

    I opened a bug report about it with Apple who closed the radar and marked it as “behaves as intended.”

Tips: Updating the Adobe Flash plugin for Firefox (and Safari) on Mac

I’ve routinely found the standard Adobe Flash player updater for Mac (OS X/macOS) fails right at the end, without explanation.

However there is a version that always works. Go to:

… and choose Flash player for Safari and Firefox – NPAPI – the download URL is normally:

The opening dialog box should look a bit different – like this:

Adobe Flash Installer

Firefox plugin checker

This is a very fast and handy way of seeing if your copy of Flash or Silverlight is up to date.

Update: Yahoo! Weather

Since the old Yahoo feeds stopped working, I’ve switched my code to use

Note, contrary to what the documentation says, you don’t  need any API keys or authentication.  You can just make a standard GET request and get JSON data back.

The developer page mentions a rate limit of 2,000 signed calls a day but again there’s no indication if/how this is being enforced.

The format is slightly different.  First you need to construct a YQL query, however this is well documented.

Some example PHP code of my own (using the FuelPHP framework):

// Build query for correct city
$BASE_URL      = "";
$yql_query     = sprintf('select * from weather.forecast where woeid in (select woeid from geo.places(1) where woeid=%d)',

$yql_query_url = $BASE_URL . "?q=" . urlencode($yql_query) . "&format=json";

// Make call with cURL
$session = curl_init($yql_query_url);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($session);

if (curl_errno($session)) {
    \Log::error('Yahoo check: '.curl_error($session));

$weather_data = json_decode($json);

if (! property_exists($weather_data, 'query')) {
    return false;

return $weather_data->query->results->channel;

Note, regardless how much data you request, the results are contained inside a JSON channel object, which is inside results, which in turn is within the main query object.

Troubleshooting Composer timeouts (IPv6 issue)

If composer hangs and you eventually see this error:

The "" file could not be downloaded: failed to open stream: Operation timed out

it could be a problem with IPv6 (for example if you’ve lost your IPv6 address for some reason.)

On MacOS you can turn IPv6 on and off via the command line.  This:

networksetup -listallnetworkservices

…will give you a list of network interfaces (e.g. Ethernet, Wi-Fi, any VPNs)

networksetup -getinfo Wi-Fi

…will list all it’s settings; IP address, MAC and IPv6 status.

networksetup -setv6off Wi-Fi

…will turn IPv6 off. (To turn it back on, you’ll typically want -setv6automatic, though there’s also an option to set it manually.)

In my experience turning it off fixed the problem immediately, and composer worked straight away.

Obviously it’s preferable to fix your IPv6 and turn it back on, but this may be inconvenient if you have to reboot router etc. or beyond your control if there’s a problem with your ISP.

Useful page to test your IPv6 connection:

See also this GitHub issue

Tested with MacOS El Capitan 10.11.5

Troubleshooting Laravel ‘Class log does not exist’ error

This is a common problem – the error is in Illuminate/Container/Container.php (line 736 or 741).

Forum thread

Common reason: spaces in environment variable values in .env file

Two other fixes that have worked for me:

  • after an apt-get upgrade on Homestead, installing the php7.0-mbstring package fixed it (Laravel needs four PHP extensions: OpenSSL, PDO, Mbstring and Tokenizer)
  • on another installation, changing syntax from:


    'production' === env('APP_ENV')

    in a ternary operator in config/app.php was the solution.