This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace EasterEgg; | |
use DateTime; | |
class Module | |
{ | |
public function onBootstrap(MvcEvent $e) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DbResolver implements ResolverInterface | |
{ | |
protected $adapter; | |
public function __construct(AuthAdapter $adapter) | |
{ | |
$this->adapter = $adapter; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'slm_queue' => [ | |
'worker' => [ | |
'max_runs' => 100, | |
], | |
'queues' => [ | |
'default' => [ | |
'deleted_lifetime' => -1 | |
], | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'vendor/autoload.php'; | |
$pheanstalk = new Pheanstalk_Pheanstalk('127.0.0.1'); | |
$pheanstalk->useTube('default'); | |
$n = 1000000; | |
$start = microtime(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyEmailThingy; | |
class Module | |
{ | |
public function onBootstrap($e) | |
{ | |
$app = $e->getApplication(); | |
$em = $app->getEventManager(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zend\Mvc\MvcEvent; | |
class Module | |
{ | |
public function onBootstrap($e) | |
{ | |
$app = $e->getApplication(); | |
$sl = $app->getServiceManager(); | |
$em = $app->getEventManager(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyFactory implements FactoryInterface | |
{ | |
public function createService() | |
{ | |
$adapter = // get adapter based on config; | |
$service = new Service($adapter); | |
return $service; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a Tracker module for Google Analytics | |
* | |
* This tracker enables to track clicks on links and submits on forms. Usually | |
* these events will not be recorded as the window.location is changed and the | |
* request to Google Analytics is cancelled. This module prevents default | |
* behaviour, tracks the Google Analytics event and then continues the link/submit. | |
* | |
* Data attributes are used to augment the event with category/action/label values. | |
* Use them as "data-track-category", "data-track-action" and "data-track-label". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Foo; | |
use Zend\Http\Client as HttpClient; | |
use Zend\Http\Response as HttpResponse; | |
use Zend\Http\Exception\ExceptionInterface as HttpException; | |
use Zend\Json\Json; |