Fixing Zend Studio for Eclipse Code Assist with SVN projects

For whatever reason, when adding a project from SVN without first creating the PHP project, you lose code assist.

Found a very useful post that addressed this, with a pretty simple fix by editing the .project file:

Change buildCommand name to:
org.eclipse.php.core.PhpIncrementalProjectBuilder

And natures to:
org.eclipse.php.core.PHPNature

Refresh/Rebuild and Zend/Eclipse will once again be as helpful (or annoying) as ever.

Passing Javascript Arrays to PHP

Needed to pass a simple Javascript array to a PHP script for some back end processing. Here’s a quick and dirty way of doing so by ’serializing’ the javascript array as a string to send along in your request, and then splitting this string into tokens to create a PHP array.

Javascript: (using jquery javascript library)

var selections = new Array;
var userSelections;
$('#multipleSelection :selected').each(function(i, selected) {
selections[i] = $(selected).val();
});
userSelections = selections.join(”,”);

In the PHP script, it’s just a matter of processing the individual elements of the array. Depending on how you sent the ajax request (POST/GET).

PHP Example:

$selectionsArray = explode(',',$_GET['userSelections']);

foreach($selectedArray as $index=>$value) {
echo $index .” = “.$value;
}

Project ‘DorkPro’

Dork Pro ready to go.

I recently decided to trade up from my Mac Mini, and into something a bit more powerful. Which led me to create the ‘DorkPro‘.

Made out of cheap PC hardware and put into carefully wedged into a discarded G5 case, the Dork Pro performs like a real Mac Pro, at a fraction of the cost.


Read Article

Mac Mini eSATA

macmini
Warranties be damned.  This article explains how to connect larger/faster full size 3.5-inch hard disks to Mac Mini using eSATA.

The Mac Mini is modified to route the internal SATA port to be used as an eSATA connection, providing full native SATA speed, which is much faster than Firewire 400 or USB 2.0.

Read Article