Skip to content

Instantly share code, notes, and snippets.

View lazymanc's full-sized avatar

Phil Moorhouse lazymanc

View GitHub Profile
@lazymanc
lazymanc / gist:1486168
Created December 16, 2011 14:09
sfWebBrowser cached version
<?php
/**
* Extended version of sfWebBrowser to provide caching functionality
*/
class tlCachedBrowser extends sfWebBrowser
{
protected $cache_expiration = 86400; // 1 day default cache
/**
@lazymanc
lazymanc / gist:1485516
Created December 16, 2011 10:23
api routing
# artist api
artist:
url: /artist/*
param: { module: artist, action: methodSwitch }
# info api
info:
url: /info/*
param: { module: info, action: methodSwitch }
@lazymanc
lazymanc / gist:1485493
Created December 16, 2011 10:20
debug template
<?php var_dump($data); ?>
@lazymanc
lazymanc / gist:1485490
Created December 16, 2011 10:19
basic symfony html5 layout
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php echo $sf_content ?>
</body>
@lazymanc
lazymanc / gist:1485485
Created December 16, 2011 10:18
symfony 1.4 api action class
<?php
/**
* Extended action class for adding json rendering functionality.
*
* @author Phil Moorhouse <[email protected]>
* @package tlv4
* @subpackage api
*/
class tlApiActions extends sfActions
{
@lazymanc
lazymanc / sfValidatorCreditcardNumber.class.php
Created June 7, 2011 15:26 — forked from anonymous/gist:181049
Credit card validator for Symfony 1.4
<?php
/*
Credit Card Validator
Date - Sep 04, 2009
Author - Brent Shaffer
Fixed bug with some of the regular expressions not matching
(switch, jcb, enroute).
$(document).ready(function(){
$("#checkAll").click(function(){
$('input[type=checkbox]').each(function(){
$(this).attr('checked', true);
});
return false;
});
});
$(document).ready(function(){