Skip to content

Instantly share code, notes, and snippets.

View jdecool's full-sized avatar

Jérémy DECOOL jdecool

View GitHub Profile
@jdecool
jdecool / behat-installer.sh
Last active August 29, 2015 14:11
behat-installer.sh
#!/usr/bin/env php
<?php
// Crapy script to install and configure Behat in my PHP project
// Usage : curl -sS http://url/to/file | sh
$dockerRepo = 'https://github.com/jdecool/dockerfiles.git';
$dependencies = [
'behat/behat' => '~3.0',
'behat/mink' => '~1.6',
@jdecool
jdecool / clover.xml
Created August 16, 2014 06:39
Atoum code coverage - clover file
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1407360405" clover="53e29d9514264">
<project timestamp="1407360405" name="atoum code coverage">
<package name="atoumCodeCoverage">
<file name="BaseEntityWithFileManager.php" path="/home/jdecool/Workspace/NovawayFileManagementBundle/Manager/BaseEntityWithFileManager.php">
<line num="55" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="0"/>
<line num="56" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="0"/>
<line num="59" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="0"/>
<line num="60" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="0"/>
<line num="62" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="
@jdecool
jdecool / Dockerfile
Created August 13, 2014 12:59
Draft of a Dockerfile to run Behat test
FROM debian:wheezy
MAINTAINER Jérémy DECOOL <contact@jdecool.fr>
# Upgrade system
RUN apt-get update
RUN apt-get install build-essential vim htop curl unzip wget -y
# Java
RUN apt-get install openjdk-7-jre -y
<?php
namespace tests;
class BattleTest extends \PHPUnit_Framework_TestCase
{
public function testMethods()
{
$this->assertEquals('1', 1); // true
$this->assertLessThan('1', 0); // true
@jdecool
jdecool / pre-commit
Created July 15, 2014 09:45
Standard PHP Git pre-commit
#!/bin/sh
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
oIFS=$IFS
IFS='
@jdecool
jdecool / Silex Skeleton installation
Last active August 29, 2015 13:56
Silex Skeleton installation
#!/usr/bin/env php
<?php
define('ARG_NAME', 1);
define('ARG_VERSION', 2);
define('ARG_DESTINATION', 3);
installSkeleton($argv);
@jdecool
jdecool / sudoku-solver.coffee
Last active December 24, 2015 20:09
A try in CoffeeScript this weekend : Sudoku solver
class Board
constructor: (@size = 9) ->
@grid = []
init: ->
@grid = []
for x in [0 .. @size - 1]
@grid.push([])