January 2010
3 posts
Apple Mail gets stuck in a 'recovered mail' loop
I had a call today from a client who was having trouble with Apple Mail. Specifically, there was a 25mb email sent to him by a family member that Mail was continually trying to ‘recover’ and send up to his Google Apps mail account. After a bit of googling, the answer was pretty easy, though asking someone to use the ‘rm’ command who’s never used the Terminal.app was a...
Setting up Samba share for a vmware OS
Sometimes it’s useful to be able to browse via the file system via a GUI. So on the advice of @AndyGale I installed Samba on my Ubuntu OS instance and created a share for the entire server. The first part of these instructions were from labs.boulevart.be.
open the samba config sudo nano /etc/samba/smb.conf
change “security=user” to “security=share”
comment out “passdb backend = tdbsam”...
Links for setting up a VMware dev server
Have waded through the net and found these the most useful.
Download VMWare Fusion demo from https://www.vmware.com/tryvmware/?p=vmware-fusion&lp=1
Get the server image you require from http://www.thoughtpolice.co.uk/vmware/#ubuntu8.04
Install using the guide that matches your download http://www.thoughtpolice.co.uk/vmware/howto/1-minute-guide.html#ubuntu8.04
Follow these instructions for...
December 2009
2 posts
Clean inputted html with CakePHP BritaBehaviour
I’ve been using TinyMCE as a text editor in my CMSs, and whilst it’s good, it can lead to the odd empty tag/para ending up in the html, font tags and all manner of other crap (especially if M$ Word has been involved at all), so I created a cakephp behaviour that uses the HTMLPurifier class to make all inputted html valid.
First, you need to download the most recent version of the...
Be careful what you chew →
October 2009
1 post
Use MySQL's SUM function with CakePHP find()
Saw this on IRC earlier, thought I’d blog it as it’s pretty useful info.
Add this method to your AppModel:
public function sum($field='total')
{
$data = $this->find('first', array(
'conditions'=>$conditions,
'fields'=>array('SUM('.$field.') AS summed'),
'contain'=>array()
));
return $data[0]['summed'];
}
Then call it like so:
$total =...
June 2009
4 posts
1 tag
update on find('neighbours') with HABTM
And, here, to cap off a really terrible brain day, is the solution, using cake’s core functionality, to the find(‘neighours’) with habtm conundrum!
$this->Mixture->bindModel(array('hasOne'=>array('MixtureCategoriesMixture')), false);
$this->set('neighbours', $this->Mixture->find('neighbors', array(
'field' => 'Mixture.sku', 'value' =>...
1 tag
Update on find('neighbours');
After some IRCing, it appears I’d misunderstood how the array should work to get the method working correctly.
$this->set('neighbours', $this->Species->find('neighbors', array(
'field' => 'Species.latin_name', 'value' => $this->data['Species']['latin_name'],...
1 tag
Replacement for find('neighbours') when dealing...
Found brain, solution realised, brainfart over, see http://blog.jben.net/post/125858269/update-on-find-neighbours-with-habtm
2 tags
Long winded replacement for find('neighbours')
Brain found, solution realised, brain fart over, see http://blog.jben.net/post/125844770/update-on-find-neighbours
March 2008
1 post
2 tags
Mystery open_base_dir errors with CakePHP 1.2
A question came up on #cakephp about mystery open_base_dir errors, so I thought I’d document my fix. As I don’t use any other libraries when working with Cake projects, I simply removed the existing include path in /app/webroot/index.php. on line 69 change: ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR ....
April 2007
1 post
First Post
Found tumblr on bbc.co.uk news, probably won’t post again, but ya never know! j