MAMP Pro /etc/hosts file problems – Simplified

Lately I have been using a lot of host aliases for testing sites locally using my MAMP pro install. Adding local sites that answer to their actual site names is amazing for a development environment, especially if you find yourself testing javascript based apis that require oauth. Like the facebook or twitter apis.

MAMP Pro does have a problem however with not always turning off the entries in the /etc/hosts files when you stop the servers, so you have problems accessing the real site. Fixing this requires opening the hosts file manually and commenting or uncommenting the desired entries. A tedious pain.

So I decided to write a quick shell script that would allow me to reset the hosts file with a quick terminal command. See the one line install command and usage below.

Shell script for cleaning/resetting /etc/hosts files messed up by MAMP Pro — Gist.

CodeIgniter Plupload problems – a solution!

TL;DR

Fix the codeigniter plupload upload problem of  “You did not select a file to upload.”  by making sure that you pass the correct file array key to do upload:

$this->upload->do_upload('file');

==============================

How I found it:

I’ve been working on my first codeigniter project that required me to upload some images. For that task I chose Plupload. A super slick upload manager written by the same people that brought us tinymce.
Continue reading “CodeIgniter Plupload problems – a solution!”