Skip to content

Instantly share code, notes, and snippets.

View ludofleury's full-sized avatar
🐼
Yay

Ludovic Fleury ludofleury

🐼
Yay
View GitHub Profile
<?php
namespace Plemi\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Buzy\Browser;
/**
<?php
/*
* CLI report.
*/
$stdOutWriter = new \mageekguy\atoum\writers\std\out();
$cli = new \mageekguy\atoum\reports\realtime\cli();
$cli->addWriter($stdOutWriter);
/*
<?php
$this->storageManager
->getRepository('PlemiAuthServerBundle:Client')
->find($authCode->getClientId());
$this->storageManager
->getRepository('PlemiAuthServerBundle:Client')
->find($authCode->getClientId());
var x = 10;
function foo() {
console.log(x);
}
(function (funArg) {
var x = 20;
funArg();
})(foo);
<?xml version="1.0" encoding="UTF-8" ?>
<item>
<media>
<name></name>
<format></format>
</media>
</item>'
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 2,
@ludofleury
ludofleury / FeatureContext.php
Created July 18, 2012 17:14
Behat FeatureContext class using atoum asserter
<?php
use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Context\BehatContext,
Behat\Behat\Exception\PendingException,
Behat\Behat\Context\Step;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
<?php
namespace Retentio\Document;
use Retentio\Document\PasswordRequest;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
/**
* User
<?php
class Foo
{
public $bar;
public function setBar($bar)
{
$this->bar = $bar;
}
@ludofleury
ludofleury / gist:3379524
Created August 17, 2012 14:57 — forked from clintongormley/gist:1088986
Create index for partial matching of names in ElasticSearch
# First, create the synonyms file /opt/elasticsearch/name_synonyms.txt
# with the contents:
#
# rob,bob => robert
#
## CREATE THE INDEX WITH ANALYZERS AND MAPPINGS
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' -d '
{