Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Mickaël Andrieu mickaelandrieu

🏠
Working from home
View GitHub Profile
View yamllint.php
<?php
<<<CONFIG
packages:
- "symfony/yaml: ~2.3"
CONFIG;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Parser;
$content = file_get_contents($argv[1]);
@mickaelandrieu
mickaelandrieu / sf2_standalone_form.php
Last active Nov 26, 2015 — forked from jubianchi/sf2_standalone_form.php
How to use Symfony2 Form Component Standalone
View sf2_standalone_form.php
<?php
namespace Standalone\Form;
use \Symfony\Component\HttpFoundation as SHttp;
use \Symfony\Component\Form as SForm;
use \Symfony\Component\DependencyInjection as SDI;
use \Symfony\Bridge as SBridge;
//Register all your autoloaded functions here
//...
View run_e2e_tests
#!/bin/bash
# Runs our end to end tests in casperjs.
# Run this script as follows from the project root;
#
# bin/run_e2e_tests
printf "\e[93m > SEARCHING FOR TEST FILES \033[0m \n"
find "$PWD" -iname "*.e2e.spec.js" -type f -print0 | while read -d '' -r file; do
We couldn’t find that file to show.
View Makefile
run:
casperjs index.js && convert *.jpg video.mpeg && gify video.mpeg out.gif && rm *.jpg video.mpeg
View TestFrameworkInATweet.php
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
View Vagrant Symfony 2 box
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
View article.markdown

Les problèmes essentiels de jQuery

Cet article fait suite à la discussion entre Metal3d et Mathieu Robin.

Saluons d'abord l'article de metal3d, qui pose enfin des questions intéressantes après un article écrit trop tôt qui soulignait surtout les difficultés qu'il avait en découvrant jQuery et en essayant de l'utiliser comme Mootools (ce qui ne peut bien sûr pas fonctionner).

Cependant, on sent bien dans cet article que les problèmes fondamentaux commencent à être touchés sans toutefois être exactement saisis. Laissez-moi vous présenter mon point de vue.

La peur des natives

View BaseFormFlowHandler.php
namespace ...;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Form;
abstract class BaseFormFlowHandler extends BaseFormHandler
{
protected $step;
protected $request;