Amberjack: JavaScript Site Tour Creator

Amberjack: JavaScript Site Tour Creator:

Arash Yalpani has released Amberjack, a tiny and Open Source/GPLed JavaScript library you can use to create nice looking tours for a web site.

There is a tour wizard to make it simple to create your own tours, and a JSON technique is used to post-fetch skins.

Checkout a sample tour to see it in action.

Amberjack

This is pretty cool, would be a nice addition for complicated web applications, especially if they break user conventions or expectations. Also useful if you have a site that has hidden (to reduce visual clutter) interface options.

(Via Ajaxian Blog.)

Quick and Dirty getting your CakePHP to REST

For CakePHP 1.1xxx

Here are the things I did to get it to work at a bare minimum for a REST style service

Turn on webservices in config/core.php by uncommenting this line (or changing ‘off’ to ‘on’)

define('WEBSERVICES', 'on');

make a rest.php file in controllers/components

  1. <?php
  2. class RestComponent extends Object {
  3. }
  4. ?>

make a rest.php file in views/helpers

  1. <?php
  2.    class RestHelper extends Helper
  3.    {
  4.    }
  5. ?>

in views/layouts make a folder called ‘rest’ and put a default.thtml file in it

  1. <?php echo $content_for_layout; ?>

for the controller that you want a rest service make a folder called rest in views/controllername/ in there put the view for the action like

  1. <?php e(‘<?xml version="1.0" encoding="utf-8" ?>‘);
  2. if (isset($applications) and !empty($applications)) :  ?>
  3. <rsp stat="ok">
  4. <applications type=’array‘>
  5.        <?php foreach ($applications as $application) : ?>
  6.                <application type=’struct‘>
  7.                        <name><?php e($application['Application']['name'])?></name>
  8.                        <version><?php e($application['Version'][0]['value'])?></version>
  9.                </application>
  10.        <?php endforeach; ?>
  11. </applications>
  12. <?php else: ?>
  13. <rsp stat="fail">
  14.        <err type=’struct‘>
  15.        <?php if ($session->check(‘Message.flash’)): ?>
  16.                <msg><?php e(strip_tags($session->read(‘Message.flash’)));?></msg>
  17.        <?php endif; ?>
  18.        </err>
  19. <?php endif; ?>

In the controller you can add logic like below to control output paths based on the service.

  1. if ($this->params[‘webservices’] == ‘Rest’) {
  2.     $this->set(‘order’,$this->Order->read());
  3. }
  4. else {
  5.     $this->redirect(‘/orders/index’);
  6. }

I’ll work on fleshing this out later and then finish the article I started in the bakery, I promise.

Spelling Cow: JS Spell Checker

Spelling Cow: JS Spell Checker:

Spelling Cow allows you add a script tag, and spell check is enabled on your website. There are also some variables you can tweak too if advanced features are needed.

This means that you can add spell checking to your applications, but as the latest browsers have added inline spell check, is there use to it?

This is a neat tool and would probably be fairly easy to add…

(Via Ajaxian Blog.)

DevShed: Debugging and Performance

DevShed: Debugging and Performance:

In another part of their series of excerpts from the Zend PHP Certification Guide (from Zend), DevShed has posted this article talking about debugging and performance issues and methods.

In this article they look at things like flattening if statements, spplitting single commands across multiple lines, and the difference between =, ==, and ===.

Worth reading, some good tips and things to keep in mind.

(Via PHPDeveloper.org.)

HiveMind on PHP and Java

HiveMind on PHP and Java:

Our buddies over at hivemind.co.uk have published another PHP article. This time, instead of decrying PHP, they show how to use the PHP-Java bridge. The article itself, titled How to Bridge PHP and Java for Powerful Web Solutions it technically solid for the most part. I wonder about the advice on creating an autoexec.bat file to set your PATH and Java’s CLASSPATH but it is technically accurate, you can do it this way.

Beyond that, there is a good primer for getting the JDK setup and operating on your machine in a minimum number of steps. (and since it’s Windows based, it’s important to know that no reboots are required for this installation.) Once you have the JDK installed, they walk you through a quick “hello world” of creating a Java class and using it in PHP.

Seems prety simple and if you have existing Java code it is cool to leverage that, I wonder how this relates to the java bridge in Zend Plateform.

(Via Zend Developer Zone.)

A different way to do a Seth Dillingham Birthday Century

So a year or so ago when I started road bike riding, I was inspired by Seth’s birthday century rides to try one last year, but I hadn’t been riding very long and 100 miles is a long way… This year I signed up for the Tour of Tucson, a 100+ mile perimeter ride around Tucson AZ (where I live). This is a pretty big event here, 8000+ riders, roads closed, two wash (dried river beds, think expanse of sand) crossings and great support, even one firehouse that makes pancakes for all comers… I had hoped to finish in under 6 hours, but due to some work issues and just life in general my training wasn’t quite where I had hoped it would be. So after 112 miles, 5 hours 54 min of riding time (as measured by the cycle computer) but with wash crossings and stopping to get some more water, oficial time was 6:18, still not too bad. And as Arnold would say…. I’ll be back!