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. |
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 | |
| // 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); | |
| } |
| 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. | |
| // |
| #! /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. |