Skip to content

Instantly share code, notes, and snippets.

@ninetwentyfour
Created August 28, 2011 21:03
Show Gist options
  • Select an option

  • Save ninetwentyfour/1177229 to your computer and use it in GitHub Desktop.

Select an option

Save ninetwentyfour/1177229 to your computer and use it in GitHub Desktop.
Haml, Sass, Markdown, and CakePHP - Oh My! 1 - blogpost
var $view = 'Haml';
Configure::write('Haml.format', 'html5');
Configure::write('Haml.filterDir', VIEWS.'filters');
App::import('Vendor', 'HamlParser', array('file'=>'phamlp'.DS.'haml'.DS.'HamlParser.php'));
App::import('Vendor', 'HamlParser', array('file'=>'haml'.DS.'HamlParser.php'));
Configure::write('Sass.style', 'compressed');
Configure::write('Asset.filter.css', 'sass.php');
App::import('Vendor', 'SassParser', array('file'=>'phamlp'.DS.'sass'.DS.'SassParser.php'));
App::import('Vendor', 'SassParser', array('file'=>'sass'.DS.'SassParser.php'));
header("Content-Type: text/css");
header("Expires: " . gmdate("D, j M Y H:i:s", time() + DAY) . " GMT");
header("Cache-Control: cache"); // HTTP/1.1
header("Pragma: cache"); // HTTP/1.0
ob_start ("ob_gzhandler");
header("Content-Type: text/css");
$seconds_to_cache = 31556926;
$ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
header("Expires: $ts");
header("Pragma: cache");
header("Cache-Control: maxage=$seconds_to_cache");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment