Skip to content

Instantly share code, notes, and snippets.

<?php
$client = new \GuzzleHttp\Client();
if ('production' !== getenv('APP_ENV')) {
$client->addSubscriber($logSubscriber);
$client->addSubscriber($debugBarSubscriber);
}
return $client;
<?php
return [
'key 1' => 'value 1',
'key 2' => 'value 2',
'key 3' => 'value 3'
];
<?php
return [
'key 1' => 'value 1',
'key 2' => 'value 2',
'key 3' => 'value 3',
'key 4' => 'value 4',
];
var angular = require('angular');
var bower = require('bower');
var gruntContribSass = require('grunt-contrib-sass');
var angular = require('angular');
var bower = require('bower');
var gruntContribSass = require('grunt-contrib-sass');
@hannesvdvreken
hannesvdvreken / example_bad.json
Created April 24, 2015 15:43
alligned keys json object definition
{
"key" : "value 1",
"changed_key": "value 2"
}
@hannesvdvreken
hannesvdvreken / example_good.json
Last active August 29, 2015 14:19
non-alligned json object definition
{
"key": "value 1",
"changed_key": "value 2"
}
@hannesvdvreken
hannesvdvreken / results.md
Last active August 29, 2015 14:17
Reflection tests accross php

These are the results of my experiments using league/container to create 100k objects and calling 100k callables. When using no reflection, the container is first made aware of all the object/functions and their dependencies.

PHP Version Time creating objects (in ms) Time to call callables (in ms)
5.3.29 (no reflection) 2057 2957
5.3.29 (with reflection) 2297 3387
5.4.38 (no reflection) 1315 1906
5.4.38 (with reflection) 1396 2252
5.5.22 (no reflection) 1263 1825
@hannesvdvreken
hannesvdvreken / phpunit
Created March 3, 2015 20:51
phpunit output for alexbilbie/proton
vagrant@ubuntu:~/code/Proton$ vendor/bin/phpunit
PHPUnit 4.5.0 by Sebastian Bergmann and contributors.
Configuration read from /home/vagrant/code/Proton/phpunit.xml
Deprecated configuration setting "strict" used
...........
Time: 2.46 seconds, Memory: 7.25Mb
@hannesvdvreken
hannesvdvreken / index.php
Last active August 29, 2015 14:16
proton script to test booboo integration
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
require 'vendor/autoload.php';
$app = new Proton\Application();
$app->get('/user/{username}', function (Request $request, Response $response, $args) {