The Mythbusters had a recent episode testing if drinking beer and liquor would make you more sick thann drinking just beer. They got the myth wrong in the first place. The real myth is that if you drink beer before liquor you will get sick, but not if you drink liquor before beer. Their test… Continue reading Mythbusters Beer and Liquor Analysis
Author: Seth Cardoza
CakePHP HasAndBelongsToMany (HABTM) Checkboxes Instead of Multiple Select
Changing CakePHP’s default multiple select for HasAndBelongsToMany (HABTM) relationships to use multiple checkboxes used to be an arduous task. It is now a simple option as follows. If you have a Post model that has a HABTM relationship with a Tag model, you would use the following line to display multiple checkboxes instead of the… Continue reading CakePHP HasAndBelongsToMany (HABTM) Checkboxes Instead of Multiple Select
Akismet API Component for CakePHP 1.2
This is a component for CakePHP 1.2 and PHP 5+ that utilizes the Akismet API to fight comment SPAM. You will need an API key, which can be retrieved from wordpress.com. <?php/** * This is a component for CakePHP that utilizes the Akismet API * * See http://akismet.com/development/api/ for more information. * * Licensed under The MIT License *… Continue reading Akismet API Component for CakePHP 1.2
CakePHP Reverse Routing
CakePHP provides a very strong and flexible routing engine, for both routing, and reverse routing. Creating a route for the home page is as simple as adding the following line to your routes.php configuration file. Router::connect(‘/about_us’, array(‘controller’ => ‘pages’, ‘action’ => ‘display’, ‘about_us’)); Now, anyone visiting http://example.com/about_us page, will see the view defined in your… Continue reading CakePHP Reverse Routing
If You Want to Charge for a Service Online, Make Sure You Engage Your Customers
I recently switched my invoicing system from Simply Invoices to Fresh Books. Simply Invoices was great while I used it, but the complete lack of customer service forced me to switch. Admittedly, I was using their services for free, but I repeatedly requested/suggested new features that would not only benefit me, but all users, with… Continue reading If You Want to Charge for a Service Online, Make Sure You Engage Your Customers
Disabling Layouts and Views in CakePHP
It is easy to disable both the layout and view in CakePHP by putting the following line in your controller action: $this->autoRender = false; If you want to disable just the layout, use the following line in your controller action: $this->layout = false; And if you only want to disable the view for this action,… Continue reading Disabling Layouts and Views in CakePHP
CakePHP Image Helper for Front End Optimization
Going along with one of the many ways to optimize front end performance, I created an image helper for CakePHP that will get the image dimensions and include them as html attributes. <?php /** * This class builds an image tag. The main purpose of this is to get the image dimensions and * include the appropriate… Continue reading CakePHP Image Helper for Front End Optimization
Image Resizing Class
This is a simple script to resize images with PHP. It uses the GD Library functions, and is currently not compatible with ImageMagick. It will automatically determine the image type and use the appropriate functions to resize. <?php/** * This class handles image resizing. It will automatically determine the image * type and use the appropriate php… Continue reading Image Resizing Class
Changing the Default Currency in DigiSHOP
DigiSHOP is not one to let you do things on your own. The code has little comments, and none of them are useful to developers wanting to customize the shopping cart. As always, any customizations you make will void your warranty, so customize at your own risk. If you have already installed your shopping cart,… Continue reading Changing the Default Currency in DigiSHOP
Submitting a Form With jQuery
On a recent project I was working on, I had to have a form submit when the option was changed on a select box. This is a simple task with jQuery. I just had to add a the change() event listener to the appropriate select boxes, and then submit the form. It didn’t work though.… Continue reading Submitting a Form With jQuery