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.
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.
There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.
I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:
static public function listenToRoutingLoadConfigurationEvent(sfEvent $event) | |
{ | |
$r = $event->getSubject(); | |
$r->prependRoute('landing_page_noParam', new sfRoute('/some-route-there', array('module' => 'someModule', 'action' => 'showPage'))); | |
} |
<?php | |
Event::listen('illuminate.query', function($query, $bindings, $time) { | |
static $count; | |
if(App::make('env') === 'local') | |
{ | |
$logFile = __DIR__.'/../storage/logs/queries'; | |
ob_start(); | |
var_dump($bindings, $query); | |
$str = ob_get_clean(); | |
if($count === null) |
#!/bin/bash | |
# Put this file at: .git/hooks/post-checkout | |
# and make it executable | |
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587 | |
PREV_COMMIT=$1 | |
POST_COMMIT=$2 | |
NOCOLOR='\e[0m' |
This mini-article describes the methods of dependency injection, what each method implies in terms of both performance and simplicity.
This method is half manual and quite well known. Declare your classes' dependencies as constructor and pass the dependencies when you construct your instances. This approach completely skips the automation around detection of injections - but performs the best of all methods.
// Creates a new promise that automatically resolves after some timeout: | |
Promise.delay = function (time) { | |
return new Promise((resolve, reject) => { | |
setTimeout(resolve, time) | |
}) | |
} | |
// Throttle this promise to resolve no faster than the specified time: | |
Promise.prototype.takeAtLeast = function (time) { | |
return new Promise((resolve, reject) => { |