Skip to content

Instantly share code, notes, and snippets.

View ezzatron's full-sized avatar

Erin ezzatron

View GitHub Profile
@ezzatron
ezzatron / Vagrantfile
Last active August 29, 2015 14:07
HHVM CLI test box
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.provision "shell", inline: <<-shell
echo "Installing apt packages"
apt-get install curl git python-software-properties screen vim -y --force-yes
echo "Installing HHVM"
@ezzatron
ezzatron / 0-overview.md
Created July 8, 2014 04:14
Benchmarking new PHPUnit annotation resolution against the sebastian/money test suite (round 2)

Benchmarking new PHPUnit annotation resolution against the sebastian/money test suite (round 2)

Host machine

  • 27" iMac, late 2013
  • 3.2 GHz Intel Core i5
  • 8 GB 1600 MHz DDR3
  • PHP memory_limit of 128MB

Summary of runs

@ezzatron
ezzatron / 0-overview.md
Last active August 29, 2015 14:03
Benchmarking new PHPUnit annotation resolution against the sebastian/money test suite

Benchmarking new PHPUnit annotation resolution against the sebastian/money test suite

Host machine

  • 15" MacBook Pro Retina, Late 2013
  • 2.3 GHz Intel Core i7
  • 16 GB 1600 MHz DDR3
  • PHP memory_limit of 128MB

Summary of runs

@ezzatron
ezzatron / 0-overview.md
Last active August 29, 2015 14:03
Benchmarking new PHPUnit annotation resolution against the Symfony 2 test suite

Benchmarking new PHPUnit annotation resolution against the Symfony 2 test suite

Host machine

  • 27" iMac, late 2013
  • 3.2 GHz Intel Core i5
  • 8 GB 1600 MHz DDR3
  • PHP memory_limit of 128MB

Summary of runs

@ezzatron
ezzatron / ipv4Validation.php
Last active December 28, 2015 09:59
PHP IPv4 validation profiling
<?php
function ipv4AddressData()
{
// address isValid
return array(
'Single digit 0' => array('0.0.0.0', true),
'Single digit 1' => array('1.1.1.1', true),
'Single digit 9' => array('9.9.9.9', true),
'Double digit 10' => array('10.10.10.10', true),
@ezzatron
ezzatron / gfm2html
Last active December 17, 2015 10:39
Filthy h4x for converting GitHub flavoured Markdown to HTML with identical styling.
#!/usr/bin/env php
<?php
$header = <<<'EOD'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@ezzatron
ezzatron / liberator.php
Created March 9, 2013 08:55
Simple Liberator explanation
<?php
/**
* Firstly, some background information on reflection.
*
* Reflection is a way to find out information about objects, methods,
* functions, and other language constructs at runtime. In the case of PHP, it
* can also be used to change the behaviour of these constructs. One of the ways
* it can do this is to tell PHP to ignore 'private' and 'protected' access
* modifiers.
@ezzatron
ezzatron / versions.php
Created February 20, 2013 12:31
Siesta API definition ideas
<?php
class Version1 extends AbstractApiDefinition
{
public function configure()
{
$this->setMajorVersion(1);
$this->add('kjdfgiuhdfg', $endPoint);
$this->add('kjdfgiuhdfg', $endPoint);
@ezzatron
ezzatron / composer.lock.first.json
Created September 27, 2012 06:06
Composer issue #1123 lock files
{
"hash": "9eecffb49244d2f6f97097ad928bb43c",
"packages": [
],
"packages-dev": [
{
"name": "eloquent/enumeration",
"version": "3.0.1",
"source": {
@ezzatron
ezzatron / DeterminePerClass.php
Created August 11, 2012 04:36
Options for Typhoon validator design
<?php
namespace Foo\Bar;
use Typhoon\Foo\Bar\BazTyphoon;
class Baz
{
public function __construct()
{
$this->typhoon = Typhoon::getValidator(__CLASS__, func_get_args());