Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: supervisord | |
| # Required-Start: $remote_fs | |
| # Required-Stop: $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Example initscript | |
| # Description: This file should be used to construct scripts to be | |
| # placed in /etc/init.d. |
| var LiveCollection = (function (_, Backbone) { | |
| var Collection = Backbone.Collection; | |
| // Define a Backbone Collection handling the details of running a "live" | |
| // collection. Live collections are expected to handle fetching their own | |
| // data, rather than being composed from separate models. | |
| // They typically add new models instead of resetting the collection. | |
| // A custom add comparison makes sure that duplicate models are not | |
| // added. End result: only new elements will be added, instead | |
| // of redrawing the whole collection. | |
| // |
| <?php | |
| // source: http://cubiq.org/the-perfect-php-clean-url-generator | |
| // author: Matteo Spinelli | |
| // MIT License / http://creativecommons.org/licenses/by-sa/3.0/ (please re-check at source) | |
| setlocale(LC_ALL, 'en_US.UTF8'); | |
| function toAscii($str, $replace=array(), $delimiter='-') { | |
| if( !empty($replace) ) { | |
| $str = str_replace((array)$replace, ' ', $str); | |
| } |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| abstract class BaseModelManager { | |
| protected $em; | |
| protected $class; | |
| protected $repository; | |
| protected $container; | |
| /** | |
| * Constructor. |
| <!doctype html> | |
| <title>Site Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: #dc8100; text-decoration: none; } | |
| a:hover { color: #333; text-decoration: none; } | |
| </style> |
| <?php | |
| namespace SiteModuleTest; | |
| use Zend\Loader\AutoloaderFactory; | |
| use ApplicationModuleTest\ServiceManagerTestCase; | |
| $basePath = __DIR__ . '/../../../../'; | |
| chdir(__DIR__); |
| ### ENVIRONMENT VARIABLES ### | |
| SetEnv PHP_VER 5 | |
| SetEnv REGISTER_GLOBALS 0 | |
| ### MAIN DEFAULTS ### | |
| Options All -Indexes | |
| DirectoryIndex index.html index.htm index.php | |
| AddDefaultCharset UTF-8 | |
| ### MIME TYPES ### |
dropbox
friendsfeed