Skip to content

Instantly share code, notes, and snippets.

View asakurayoh's full-sized avatar

Maxime Lafontaine asakurayoh

View GitHub Profile
adamwathan / promise-take-at-least.js
Last active February 26, 2023 14:25
// 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) => {
NamelessCoder /
Last active February 12, 2020 15:59
Why you should never use @Inject in TYPO3 Extbase

This mini-article describes the methods of dependency injection, what each method implies in terms of both performance and simplicity.

  1. Constructor injection

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.

lyrixx / post-checkout
Created June 26, 2013 13:37
Git post checkout
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see
kapv89 / query-logger.php
Last active January 8, 2019 15:21
Log Queries in L4
Event::listen('illuminate.query', function($query, $bindings, $time) {
static $count;
if(App::make('env') === 'local')
$logFile = __DIR__.'/../storage/logs/queries';
var_dump($bindings, $query);
$str = ob_get_clean();
if($count === null)
daum / gist:5051173
Last active December 14, 2015 07:29
static public function listenToRoutingLoadConfigurationEvent(sfEvent $event)
$r = $event->getSubject();
$r->prependRoute('landing_page_noParam', new sfRoute('/some-route-there', array('module' => 'someModule', 'action' => 'showPage')));
anchetaWern / laravel-ums.markdown
Created December 6, 2012 11:14
Building a User Management System in Laravel

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:

  • Register Roles
  • Register Users
  • Update Users
ziadoz /
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.