Welcome to MainelyDesign.com

Photos of Rockland, Maine. Summer 2009.

A blog mostly about web design

This is the personal blog of Kevin Wentworth.  Topics covered here are web programming, design and internet marketing.

CakePHP 3 - Accept JSON Header Only Working When Debug False

Posted 3 weeks, 1 day agoViewed 145 times

Strange thing... when you have debug disabled you may find that your application works fine when dealing with json routes without the extension.  Instead of accessing /posts.json, you would access /posts and send an Accept: application/json header and the same thing is achieved. Debug On - Json View Templates Don't Load - Same Accept Header I...

Remove All Events from Google Calendar (Reset Calendar)

Posted 4 weeks agoViewed 88 times

I've been doing a lot of programming with the Google Calendar API lately and ran into an issue when I was ready to "go live" with the site.  The Google Calendar was loaded with tons of test data!  I searched around and found plenty of sites giving the same answer.  The problem with the answer- it was incomplete.  If you want to reset a calendar...

Google Tag Manager (GTM) Not Firing Default PageView Event

Posted on 11/08/2017 at 12:21 pmViewed 1,218 times

We had an interesting issue here today regarding Google Tag Manager not firing the default PageView event.  Instead it was firing the /gtm.js event.  WTF?! Turns out, the system we were using was reading event: 'gtm.js'  in the GTM container snippet as a link to a javascript resource.  So, it was turning the "url" into an absolute path, like...

In PHP, how do you get __toString() Magic Method Result without calling echo?

Posted on 10/13/2017 at 01:49 pmViewed 956 times

I knew this answer at one point, then forgot it.  So, here it is for memory's sake... How can you get __toString() Magic Method Output WITHOUT using echo statement? $echoed = strval($object->property); Cheers, - Kevin Wentworth

Getting output from shell_exec() at all times

Posted on 11/14/2016 at 12:18 pmViewed 2,025 times

Sometimes shell_exec() won't output anything.  This might be because of an error or a silent success.  If you want to see the output, you can always do this: $output = shell_exec('$HOME/aaa/command 2>&1'); echo "<pre>$output</pre>";

Read More Posts.

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design