This is a very simple mobile validation for Australian Mobiles. It probably would also benefit from having all the symbols except + stripped too // src/Model/Table/Users.php where Users is the class name // of the table field your are validating $australianMobile =...
James McDonald
Car Mounted Traffic Guidance Drone
An idea A car with a small compartment with an automatic door. The compartment contains a charging cradle and a small micro-drone with a hi res camera and a wi-fi connection back to the car The cars on-board computer releases the drone when the car driver, or the cars...
Apache Reverse Proxy with Websocket
This is the working configuration for an SSL Apache 2.4.6 Reverse Proxy back to an Apache-Coyote/1.1 server, including letsencrypt configuration to allow the automated renewal of certificates using a local webroot on the Reverse Proxy Server Apache Reverse Proxy SSL...
Embedding ReactJS in a CakePHP View
When people say they want to use CakePHP with React typically the recommendation is to convert CakePHP into an API server and then add ReactJS as the front-end served on a different URL than CakePHP. But what about when you have a CakePHP application and you...
NextJS + Redux Testing
Been trying to implement some tests for NextJS Redux App. You can get most of the way there by following the very good information here => http://redux.js.org/recipes/writing-tests But if you drop .babelrc into your NextJS project as per above it stops the npm run...
Javascript Tips: Scope your case blocks with curly brackets
Give your react props default values If you pass null as a prop then you get warnings about going from a controlled to uncontrolled component Renaming variables when...
Dealing with Flashes of Unstyled Content in NextJS
So I made a YouTube video of a challenge I had of a FontawesomeIcon React component flashing to massive when loading the page and then back to the right size. This video shows the work-a-rounds. I tried to include the code snippets here but the self hosted wordpress...
Working around SVG Swallowing Click Events
I have used FortAwesome/react-fontawesome to put a trash icon on a nextjs react page. <a data-part_id={id} data-meeting_id={meetingId} onClick={(e) => { e.preventDefault(); console.log(event.target) window.confirm('Do you really want to...
CakePHP 3 returning invalid sort order
CakePHP with a query string /api/parts/getParts?sort=sort_order&direction=asc&limit=100 Returns items out of order. See below for the work-a-round { "parts": [ { "sort_order": 10 }, { "sort_order": 20 }, {...
NextJS
I came across NextJS when looking at the excellent DevTips YouTube channel video regarding Going from Sketch to React.js #2 Building an Online Business NextJS solves some of the problems that I found hampered me in using React: Server Side Rendering out of the box...
Amazon Billing Estimation and it’s link to Myocardial Infarctions
Take a look at this graphic and see if you can see when I first looked at it why I might have felt a tightness in my chest and shortness of breath. I think the cause of this Forecast being so high in comparison to the preceding months spend is that I have purchased a...
MYSQL – Performing an UPDATE on a table you are SELECTing from
I needed to change a record in a customer table to be inactive if they hadn't received a delivery in the last 3 months. I got stuck with "Error Code: 1093. You can't specify target table 'customers' for update in FROM clause" UPDATE customers c1...
CakePHP 3.x Google No Translate Meta Tags
Just had a page think it was french despite having So to get CakePHP to make the recommended meta tags as listed here => https://stackoverflow.com/a/3130857/9230077 <?=...
Example Curl POST request for XML document from CakePHP
This is an example of using the curl command to request a CakePHP URL and post form data to it. It uses xmllint to format the output and highlight (under MacOS) to colorize the output #!/bin/sh # save as curlIt.sh curl -s \ -d...
Brew Wine on MacOS Ugly Fonts
Wine 3.0.1 MacOS 10.13.5 If you have recently done a brew install wine and found that suddenly your fonts are ugly. A work-a-round is: to remove the current version of XQuartz (2.7.11) and downgrade to XQuartz-2.7.9.dmg install the wine stable version...
Ubuntu 18.04 Display and Resolution problems VMWare VSphere Client v 5.5 Console
Can't seem to get Ubuntu 18.04 working on VMWare Console Mouse pointer is offset in the VMWare VSphere Client Console. Things just not working properly, going fullscreen in the console and the resolution was pegged at 1024x768 despite having tried open-vm-tools &...
Class XMLReader does not exist
Just on the Joomla 3.8.8 "You have post-installation messages" page and when I click the "Read Messages" button I get taken to a page with an error message: At the moment I have plenty of XML modules installed but not the one I need: php -m |...
PHP7.2 Image Magick
On a brew installed php7.2 on my MacOS 10.13.5 I get an error when running /usr/local/php5/bin/php from the command line: Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/imagick.so' (tried:...