https://speakerdeck.com/benjam1/adoptez-le-tdd-sur-vos-projets-symfony2-existants
http://davidbu.ch/slides/20130404-sflive_phpcr.html
https://dl.dropboxusercontent.com/u/581816/sflive_Paris_2013_DIC_-_Thomas_Rabaix.pdf
class MoneyType extends AbstractType implements DataMapperInterface | |
{ | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
$builder | |
->add('amount', 'integer') | |
->add('currency', 'string') | |
->setDataMapper($this) | |
; | |
} |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>feature</string> | |
</array> | |
<key>firstLineMatch</key> | |
<string>기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd(.*)</string> |
#!/bin/bash | |
# use newline as separator | |
IFS=$'\n' | |
for author in $(git log --all --format='%cN' | sort -u); do | |
echo $author; | |
git log --all --author="$author" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "++ %s\n-- %s\n= %s\n", add, subs, loc }' - | |
done |
This was a quick & dirty benchmark (for my own needs) to compare the method to get a class name in PHP | |
-ReflectionObject->getName(); | |
-get_class(); | |
-ReflectionClass->getName(); | |
It was performed on my local machine : MacBookPro with PHP 5.3.6 | |
You will find the result below and the code used for the 3 tests. | |
ReflectionObject | |
Memory : 750040 |
before_script: | |
- ./path/to/mongo-php-driver-installer.sh |
# If you come from bash you might have to change your $PATH. | |
export PATH=$HOME/bin:/usr/local/bin:$PATH:/Users/ludo/Library/Python/3.7/bin | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/ludo/.oh-my-zsh" | |
ZSH_THEME="powerlevel9k/powerlevel9k" | |
# CASE_SENSITIVE="true" | |
# HYPHEN_INSENSITIVE="true" |
<?php | |
// Works in every situations | |
function by_token ($src) { | |
$tokens = token_get_all($src); | |
$count = count($tokens); | |
$i = 0; | |
$namespace = ''; | |
$namespace_ok = false; | |
while ($i < $count) { |
<?php | |
use Behat\Symfony2Extension\Context\KernelAwareInterface; | |
use Behat\Symfony2Extension\Context\KernelDictionary; | |
use Behat\MinkExtension\Context\MinkContext; | |
class MysqlContext extends MinkContext implements KernelAwareInterface | |
{ | |
use KernelDictionary; | |
# 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 ' | |
{ |