Skip to content

Instantly share code, notes, and snippets.

#target illustrator
function main()
{
var sourceDir,
destDir,
files,
sourceDoc,
sizes;
@Maff-
Maff- / AppExtension.php
Created October 14, 2015 18:17
Let a Symfony bundle configure their own Doctrine EnumTypes via the PrependExtensionInterface
<?php
namespace AppBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
class AppExtension extends Extension implements PrependExtensionInterface
{
@Maff-
Maff- / DeprecatedTypeOptionsSniff.php
Created October 17, 2015 23:38
SymfonyCleanupStandard_Sniffs_Form_DeprecatedTypeOptionsSniff
<?php
class SymfonyCleanupStandard_Sniffs_Form_DeprecatedTypeOptionsSniff extends PHP_CodeSniffer_Standards_AbstractScopeSniff
{
/**
* @inheritdoc
*/
public function __construct()
{
parent::__construct(array(T_CLASS), array(T_FUNCTION), false);
@Maff-
Maff- / ServiceAvailabilityFunctionalTest.php
Created December 5, 2015 22:44
Symfony2 Service Availability Smoke Test
<?php
namespace AppBundle\Tests;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class ServiceAvailabilityFunctionalTest extends KernelTestCase
{
protected $serviceBlacklist = [
'request',
@Maff-
Maff- / bench.php
Last active December 17, 2019 06:07
PHP Large Array Sum Micro Benchmark
<?php
declare(strict_types=1);
printf("Current PHP version: %s\n", phpversion());
$iterations = (int)($_SERVER['argv'][1] ?? 2000);
printf("Bench iterations: %d\n", $iterations);
$time = microtime(true);
//$input = array_map('intval', str_split(str_repeat(trim(file_get_contents('input.txt')), 100)));