Skip to content

Instantly share code, notes, and snippets.

View dantleech's full-sized avatar
💭
Nothing

dantleech dantleech

💭
Nothing
View GitHub Profile
@dantleech
dantleech / sourcebuilderproto.php
Last active July 11, 2017 09:26
API for source code generator / modifier
<?php
$builder = $sourceBuilder->prototypeBuilder();
$builder->namespace('Animals');
$builder->use('Measurements\\Height');
$builder->class('Rabbits')
->properties()
->property('television')
->visiblity('private')
->end()
- [Improvement] Skill Curation: Empty pending list should show message as with "Accepted" skills, e.g. "There are no pending skills".
- [Improvement][CSS/Design] Show legend for dispositions.
- [Improvement][CSS] Mouse over skill should change cursor to "finger" or similar.
- [BUG] Quickly enable/disable/change skill dispositions causes error.
- [Feature] Ajax-ify accepted skill search (controller already has a dedicated action for displaying the skill search results, just need to do XHR on that action and show the HTML).
- [Feature] Cancel button on skill edit/new does not need to reload page.
<?php
namespace PhpBench\Benchmarks\Micro;
class HashBench
{
private $hashes = [];
private $hashKeys = [];
public function generateHashes($params)
<?php
class Collection implements \IteratorAggregate
{
private $foo;
private $bar;
private $collection;
public function __construct(\Traversable $collection)
{
# compare previously recorded report with latest
$ phpbench report --uuid=133a1f6cb0331c2cedeb650f0b997f5fb3c28713 --uuid=latest --report=aggregate
suite: 133a1f6965d13f41f33ec1ba76370c4120dd45c1
+-----------+----------+--------+---------------+------+-----+------------+----------+----------+----------+----------+----------+--------+---------+
| benchmark | subject | groups | params | revs | its | mem_peak | best | mean | mode | worst | stdev | rstdev | diff |
+-----------+----------+--------+---------------+------+-----+------------+----------+----------+----------+----------+----------+--------+---------+
| KdeBench | benchKde | | {"points":10} | 100 | 10 | 1,102,568b | 0.3117ms | 0.3693ms | 0.3331ms | 0.5658ms | 0.0759ms | 20.56% | 0.00% |
| KdeBench | benchKde | | {"points":20} | 100 | 10 | 1,107,048b | 0.5799ms | 0.7697ms | 0.8444ms | 0.9212ms | 0.1198ms | 15.56% | +52.02% |
| KdeBench | benchKde | | {"points":40} | 100 | 10 | 1,116,008b | 1.
<?php
use Symfony\Component\Form\Extension\Core\Type\{
NumberType,
StringType,
RangeType,
MoneyType,
UrlType
};
<?php
use League\Uri\Schemes\Http;
class UriBench
{
/**
* Baseline - pretend we are creating a lazy Uri value object.
*/
public function benchString()
<?php
declare(strict_types=1);
namespace Psi\Component\Description;
use Psi\Component\Description\DescriptorInterface;
use Psi\Component\Description\Descriptor\ScalarDescriptor;
use Psi\Component\Description\DescriptionInterface;
<?php
namespace Symfony\Cmf\Component\ContentType\Tests\Functional;
class ServiceTest extends BaseTestCase
{
public function testServices()
{
$container = $this->getContainer();
<?php
namespace Ylly\Bolt\Extension\Fnair\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Bolt\Config;
use Symfony\Component\HttpFoundation\Session\Session;
use Ylly\Bolt\Extension\Fnair\Repository\RegionRepository;