Skip to content

Instantly share code, notes, and snippets.

# Install Passenger with RVM / Ruby 1.9.1
rvm 1.9.1 ; gem install passenger ; which passenger-install-nginx-module
# Install Apache module
rvmsudo passenger-install-apache2-module
# Restart Apache
sudo /usr/sbin/apachectl restart
# If needed (when --default doesn't stick)
// CakePHP Enkoder
// USAGE:
// Uses the same syntax as $html->link($title, $url, $htmlAttributes, $confirmMessage, $escapeTitle)
<?=$enkode->mailto('Email Me', 'user@example.com', array('subject'=>'Hello world!'))?>
// HELPER:
// app/views/helpers/enkode.php
// CakePHP Block Helper
// Ever wanted a clean way to capture a block of HTML in your CakePHP view and use it later in your layout just like CakePHP uses $content_for_layout?
// I use Rails all the time and take content_for for granted. I recently started a CakePHP project and noticed the absence of a simple content_for method to capture a block of HTML.
// For this example we are creating a helper named $cake, a controller named 'main', and using a layout named 'app'.
// HELPER:
// CakePHP Block Helper
// Ever wanted a clean way to capture a block of HTML in your CakePHP view and use it later in your layout just like CakePHP uses $content_for_layout?
// I use Rails all the time and take content_for for granted. I recently started a CakePHP project and noticed the absence of a simple content_for method to capture a block of HTML.
// For this example we are creating a helper named $cake, a controller named 'main', and using a layout named 'app'.
// HELPER: