Skip to content

Instantly share code, notes, and snippets.

View ludofleury's full-sized avatar
🐼
Yay

Ludovic Fleury ludofleury

🐼
Yay
View GitHub Profile
<?php
/**
* This file is part of the PropelBundle package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/
<?php
$controllers->post('/{myModel}/items', function (Model\myModel $myModel, Request $request) use ($app) {
//...
)}
->bind('mymodel_create')
->accept('url-encode')
->accept('json')
->contentType('kutio+xml', array('*/*', 'application/*', 'application/vnd.kutio+xml'))
->contentType('json', array('application/json', 'application/x-json'))
[15:46] == Ludof [513967f0@gateway/web/freenode/ip.81.57.103.240] has joined ##atoum
[15:46] -ChanServ- [##atoum] Welcome on channel of atoum, the simple, modern and intuitive unit test framework for PHP 5.3+ !
[15:46] <Ludof> Hello les gens
[15:46] <Ludof> si y'a du atoum boyz dans la salle, j'voudrais rapidement comprendre le coup du if(),and(),then() sur atoum, c'est le truc que j'ai pas suivi.
[15:46] == jubianchi[work] [~ABC-OBJEC@92.103.14.114] has quit [Read error: No route to host]
[15:47] <Ludof> genre typiquement: https://github.com/mageekguy/atoum/pull/108/files
[15:47] == jubianchi[work] [~ABC-OBJEC@92.103.14.114] has joined ##atoum
[16:07] <steph_py> Yop Ludof
[16:07] <steph_py> J'ai pas trop touché à cette fonctionnalité
[16:07] <steph_py> mais visiblement ça permet d'initialiser le contexte
@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 '
{
<?php
class Foo
{
public $bar;
public function setBar($bar)
{
$this->bar = $bar;
}
<?php
namespace Retentio\Document;
use Retentio\Document\PasswordRequest;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
/**
* User
@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;
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 2,
<?xml version="1.0" encoding="UTF-8" ?>
<item>
<media>
<name></name>
<format></format>
</media>
</item>'
var x = 10;
function foo() {
console.log(x);
}
(function (funArg) {
var x = 20;
funArg();
})(foo);