James McDonald

Use FORCE INDEX

Just putting this here as I have a SELECT in MySQL that was taking 1.946 sec to return 20 records from a table with 159884 records when using a ORDER BY DESC on a DATETIME field Creating an index and changing the FROM to FORCE INDEX () dropped it down to 0.00079 sec /...

Using a git repo as a composer repository

So here is the link so I don't forget it https://getcomposer.org/doc/05-repositories.md#vcs Add your repo's URL into your composer.json in the repositories key and change the version on the original repo name to your dev-* version where * is a branch of your github...

AWS to Digital Ocean DNS Record Migration

Just completed a migration away from AWS to Digital Ocean Need to install the Digital Ocean dotctl command line utility (this is using brew on a mac) brew install dotctl Transfer domain records away from AWS using the aws-cli #!/bin/bash domains=$(aws route53...

Format validationsErrors

A recursive function that takes a validation error array and return a string with all the different errors concatenated into a formatted string Further to my previous posting https://toggen.com.au/it-tips/cakephp-2-displaying-validation-errors This function will walk...

PHP Version Gotcha

Just copied some code from a PHP 7.3+ development environment to the server running PHP 7.2 On the server I am getting this On PHP 7.3 it runs fine Because the line number is not listed this is how I find the problem Find which controller is being called when you see...

Remove Sensitive Data from Git Hub

If you follow the faqs on github it will say you can use bfg to remove sensitive data https://help.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository Here are my learnings bfg has to be run from the root of the git repository i.e....

Embed Create React App SPA into CakePHP 3.8.x view

Some small changes from the old CRA version 2.x the asset-manifest.json now has an entrypoints key // view code src/Template/Assigned/schedule_edit.ctp <?php foreach ($css as $style) : ?> <?= $this->Html->css('/react' . $style, [ 'block' => true ]); ?> <?php...

G-Suite to Office 365 Migration Stalled

Following the steps at this link: https://docs.microsoft.com/en-us/exchange/mailbox-migration/perform-g-suite-migration#create-a-migration-batch-in-office-365 Trigger the migration in the ECP (Exchange Control Panel) Viewing the status of the migration Login to...

I like the smell of Laravel

So I've created number of websites and applications in CakePHP 2.x and 3.x As my coding experience has grown I found invariably I have been struggling with a number of things and while I really appreciated: Cake conventions providing consistent approach to structuring...

Toggen WMS

A few years ago I had to install a solution that would take the place of some of the functionality of an ERP that was not coming across during a business acquisition Toggen WMS (Warehouse Management System) is written using the CakePHP 2.x framework with some UI in...

Google Chrome Infuriating Redirects

Google Apps has the ability to define a custom hostname for it's calendar, drive, mail, sites, groups services How it works is you create a CNAME record in DNS that points from your custom domain to Google which then intelligently redirects you to the correct service...

Zint – FNC1

GS1-128 Barcodes have a FNC1 character at the beginning but if a field is variable length a FNC1 is embedded to delimit the end of the field from the next AI code Zint is a open source barcode generator and it already has the AI rules in it so that it knows when to...