Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am madapaja on github.
  • I am madapaja (https://keybase.io/madapaja) on keybase.
  • I have a public key whose fingerprint is 940C 5947 04CF DAB9 112C E255 00DD 5E40 6D30 BD61

To claim this, I am signing this object:

root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
@madapaja
madapaja / gist:3798483
Created September 28, 2012 07:38
Ray.Di issue13
<?php
class DbInterface {}
class DefaultDb extends DbInterface {}
class Storage {
public $db;
/**
@madapaja
madapaja / ray-pattern2.php
Created July 17, 2012 10:00
ray / symfony di
<?php
use Ray\Di\Injector;
require __DIR__.'/vendor/autoload.php';
$di = Injector::create([]);
$di->getContainer()->params['MailerInterface'] = array(
'transport' => 'sendmail',
@madapaja
madapaja / ray2-mailer.php
Created July 17, 2012 06:04
success case
<?php
abstract class MailerInterface {
private $transport;
/**
* @Inject
* @Named("transport_type")
*/
public function __construct($transport)
@madapaja
madapaja / ray-failed-on-apc.php
Created July 17, 2012 05:58
ray-failed-on-apc
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
use Ray\Di\Di\Inject;
use Ray\Di\Di\Named;
use Ray\Di\AbstractModule;
use Ray\Di\Injector;
$loader = require __DIR__.'/vendor/autoload.php';
AnnotationRegistry::registerLoader(array($loader, "loadClass"));
@madapaja
madapaja / example.html
Last active October 4, 2015 13:08
jQuery.selection demo
<!DOCTYPE html>
<html>
<head>
<!-- Load jQuery -->
<script src="http://code.jquery.com/jquery-latest.js"></script>
<!-- Load jQuery.selection plugin-->
<script src="jquery.selection.js"></script>
@madapaja
madapaja / UUID4.php
Created February 14, 2012 05:57
generate UUID4 with pure PHP
<?php
namespace Madapaja;
class UUID4
{
protected $isUpperCase;
public function __construct($isUpperCase = false)
{
@madapaja
madapaja / OdmTestCase.php
Created October 20, 2011 07:23
Base testcase class for Doctrine MongoDB ODM testcases
<?php
namespace Madapaja\ODM\MongoDB\Tests;
use Doctrine\ODM\MongoDB\Configuration;
/**
* Base testcase class for MongoDB ODM testcases.
*
* Usage: