Skip to content

Instantly share code, notes, and snippets.

View ValentinMerlet's full-sized avatar

Valentin Merlet ValentinMerlet

  • Akeneo
  • Nantes
View GitHub Profile
Feature: Testing cars
# Description de la feature
In order to drive
As a api tester
I need to be able to get cars
Background:
# On supprime les données pour les entités suivantes :
Given There is no "AppBundle:Cars" in database
# Et on insère les données suivantes :
default:
suites:
cars:
paths: [ %paths.base%/features/Cars ]
contexts:
- AppBundle\Behat\Context\ApiContext:
url: http://127.0.0.1:8000
em: @doctrine.orm.entity_manager
extensions:
@ValentinMerlet
ValentinMerlet / ApiContext.php
Last active November 21, 2015 00:49
Behat : Fonction iRequest d'un fichier Context
<?php
/**
* @When /^I request "(GET|POST) ([^"]*)"$/
*/
public function iRequest($httpMethod, $resource)
{
$this->resource = $resource;
$method = strtolower($httpMethod);
@ValentinMerlet
ValentinMerlet / snippet_feature_behat.php
Last active December 9, 2015 15:00
Behat : Hook BeforeScenarioScope
<?php
/**
* @BeforeScenario
*/
public static function prepare(BeforeScenarioScope $scope)
{
$scenarioTitle = $scope->getScenario()->getTitle();
var_dump($scenarioTitle);die(); // "Create a realizer_proposal"
}
@ValentinMerlet
ValentinMerlet / advent_of_code_day2.html
Created December 15, 2015 18:51
adventofcode.com/day2
<html>
<head></head>
<body>
<script type="text/javascript">
var input =
[
'4x23x21',
'22x29x19',
'11x4x11',
@ValentinMerlet
ValentinMerlet / advent_of_code_day1.html
Last active December 15, 2015 18:59
adventofcode.com/day1
<html>
<head></head>
<body>
<script type="text/javascript">
var input = '()()(()()()(()()((()((()))((()((((()()((((()))()((((())(((((((()(((((((((()(((())(()()(()((()()(()(())(()((((()((()()()((((())((((((()(()(((()())(()((((()))())(())(()(()()))))))))((((((((((((()())()())())(())))(((()()()((((()(((()(()(()()(()(()()(()(((((((())(())(())())))((()())()((((()()((()))(((()()()())))(())))((((())(((()())(())(()))(()((((()())))())((()(())(((()((((()((()(())())))((()))()()(()(()))))((((((((()())((((()()((((()(()())(((((()(()())()))())(((()))()(()(()(()((((()(())(()))(((((()()(()()()(()(((())())(((()()(()()))(((()()(((())())(()(())())()()(())()()()((()(((()(())((()()((())()))((()()))((()()())((((()(()()(()(((()))()(()))))((()(((()()()))(()(((())()(()((()())(()(()()(()())(())()(((()(()())()((((()((()))))())()))((()()()()(())()())()()()((((()))))(()(((()()(((((((())()))()((((()((())()(()())(())()))(()(()())(((((((())))(((()))())))))()))())((())(()()((())()())()))))()((()()())(())((())((((()())())(
@ValentinMerlet
ValentinMerlet / backup.sh
Last active March 26, 2016 13:21
Android backup
adb backup -apk -all -f backup.ab
<?php
$input = [
[1208, 412, 743, 57 ,1097 ,53 ,71 ,1029 ,719 ,133 ,258 ,69 ,1104 ,373 ,367 ,365],
[4011, 4316, 1755, 4992 ,228 ,240 ,3333 ,208 ,247 ,3319 ,4555 ,717 ,1483 ,4608 ,1387 ,3542],
[675, 134, 106, 115 ,204 ,437 ,1035 ,1142 ,195 ,1115 ,569 ,140 ,1133 ,190 ,701 ,1016],
[4455, 2184, 5109, 221 ,3794 ,246 ,5214 ,4572 ,3571 ,3395 ,2054 ,5050 ,216 ,878 ,237 ,3880],
[4185, 5959, 292, 2293 ,118 ,5603 ,2167 ,5436 ,3079 ,167 ,243 ,256 ,5382 ,207 ,5258 ,4234],
[94, 402, 126, 1293 ,801 ,1604 ,1481 ,1292 ,1428 ,1051 ,345 ,1510 ,1417 ,684 ,133 ,119],
[120, 1921, 115, 3188 ,82 ,334 ,366 ,3467 ,103 ,863 ,3060 ,2123 ,3429 ,1974 ,557 ,3090],
<?php
$input = [
[1208, 412, 743, 57 ,1097 ,53 ,71 ,1029 ,719 ,133 ,258 ,69 ,1104 ,373 ,367 ,365],
[4011, 4316, 1755, 4992 ,228 ,240 ,3333 ,208 ,247 ,3319 ,4555 ,717 ,1483 ,4608 ,1387 ,3542],
[675, 134, 106, 115 ,204 ,437 ,1035 ,1142 ,195 ,1115 ,569 ,140 ,1133 ,190 ,701 ,1016],
[4455, 2184, 5109, 221 ,3794 ,246 ,5214 ,4572 ,3571 ,3395 ,2054 ,5050 ,216 ,878 ,237 ,3880],
[4185, 5959, 292, 2293 ,118 ,5603 ,2167 ,5436 ,3079 ,167 ,243 ,256 ,5382 ,207 ,5258 ,4234],
[94, 402, 126, 1293 ,801 ,1604 ,1481 ,1292 ,1428 ,1051 ,345 ,1510 ,1417 ,684 ,133 ,119],
[120, 1921, 115, 3188 ,82 ,334 ,366 ,3467 ,103 ,863 ,3060 ,2123 ,3429 ,1974 ,557 ,3090],
<?php
$input = "81827597793116617842489265377993134215656726894684959794894446986381824811432752482413692448689179473928166874161681861461322258513274238616868751793943291175384681799747355569382131691847347445978871491766579433675362883623115957873481348568724727328892621697699251631441583698561135468282189279398392275539557759285995996657432978769393424223315994784675727952393921784419434659949485845958279832679951257136529467397895592841695512721162423414349754672934868784431786424385923866532678441434961898583225922476185737138913363571181947696985458412358956616349179644216781589953978823711833921869913749753293249222694889236255493738149738946998134697199827164436294483988395396769866542731459243895818169763959463114299115632725741318662192336963246691883695127751942169526498694226178125641237771124582537941297887613426738479369475673224679973946472121544647797273788344561566475592344144178112893336958565592561525754849962887824212243497919796956997196137936775649988453743383921783572826379843187465431