Skip to content

Instantly share code, notes, and snippets.

This tool is used to compare microbenchmarks across two versions of code. It's
paranoid about nulling out timing error, so the numbers should be meaningful.
It runs the benchmarks many times, scaling the iterations up if the benchmark
is extremely short, and it nulls out its own timing overhead while doing so. It
reports results graphically with a text interface in the terminal.
You first run it with --record, which generates a JSON dotfile with runtimes
for each of your benchmarks. Then you change the code and run again with
--compare, which re-runs and generates comparison plots between your recorded
and current times. In the example output, I did a --record on the master
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@johnkary
johnkary / gist:2890651
Created June 7, 2012 18:34
List of Symfony Live 2012 - Paris slides
Day 1 (Track A):
Keynote - Fabien Potencier
Security: In Real Life - Johannes S
https://speakerdeck.com/u/schmittjoh/p/security-in-real-life
How we built the new responsive BBC News site - John Cleveley
https://speakerdeck.com/u/jcleveley/p/how-we-built-the-new-responsive-bbc-news-site
@henrikbjorn
henrikbjorn / RelDate.php
Created December 5, 2011 08:01 — forked from arnaud-lb/RelDate.php
4 lines relative date formatter with DateInterval and Symfony2 Translator
<?php
use Symfony\Component\Translation\TranslatorInterface;
function format(\DateTime $date, TranslatorInterface $translator)
{
$diff = date_create()->diff($date);
$seconds = $diff->days * 86400 + $diff->h * 3600 + $diff->i * 60 + $diff->s;
$format = $translator->transChoice('reldate', $seconds);
@beberlei
beberlei / DateTimeConverter.php
Created August 15, 2011 17:53
DateTime converter
<?php
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Convert a date from the request to a DateTime instance.
*
* The semantics are controller semantics $varDate matches to a route parameter {var}
@ezzatron
ezzatron / clean-use.php
Created May 9, 2011 12:10
Script to clean unnecessary PHP use statements
#!/usr/bin/env php
<?php
$paths = array();
if (isset($_SERVER['argv']))
{
$paths = $_SERVER['argv'];
array_shift($paths);
if (!$paths)

1.) find() is only for finding by identifier now

	$article = $dm->find('Article', array('title' => 'test'))

to

	$article = $dm->getRepository('Article')->findBy(array('title' => 'test'));

2.) Query builder change: