BLOG

Technical tips collected over several decades in IT

Reverse Proxy Cups in Nginx

The process is similar to my previous post on proxying a sub directory back to the root. For example https://example.com/test => proxies back to / in the docker container upstream cups-endpoint { # in my case I'm using cups inside # a docker container and exposing #...

Adding custom values to Contact Form 7

https://www.wpguru.com.au/generate-dynamic-tag-contact-form-7/ From the above URL is this code. Just putting it here so I can find it again <?php add_action('wpcf7_init', 'custom_code_generator'); function custom_code_generator(){ wpcf7_add_form_tag('coupon_code',...

The REST API encountered an error

The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages. The REST API request failed due to an error.Error: cURL error 28: Operation...

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 /...

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

OPTIONS pre-flight Check CakePHP 2

Before fetch sends a POST request to another domain it will do a CORS pre-flight check. The following website has the HTTP OPTIONS middleware code you can use for CakePHP 3. It mentions for a CakePHP 2 version you need to go to another website which is unavailable now...

Login

Blog History