public function buildForm(FormBuilderInterface $builder, array $options) {
$builder->add('companyName', 'text', array('required' => false))
...
;
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote add remote <mon-repo-secondaire> | |
git fetch remote | |
git merge remote/<ma-branche> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f($a, $k) { ob_start(); debug_zval_dump($a[$k]); preg_match('/refcount\((\d+)/', ob_get_clean(), $b); return $b[1] == 1; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f($a, $k) { | |
$b = $a; | |
$c = &$k; | |
$b[$k] = null; | |
if (null === $a[$k]) { | |
$a[$k] = $c; | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$input = ['a' => 'b', 'c' => 'd']; | |
$keys = array_keys($input); | |
$values = array_values($input); | |
$i = 0; | |
while (isset($keys[$i], $values[$i])) { | |
$currentKey = $keys[$i]; | |
$currentValue = $values[$i]; |
I hereby claim:
- I am xavismeh on github.
- I am xavismeh (https://keybase.io/xavismeh) on keybase.
- I have a public key whose fingerprint is 2ACE B635 69E9 EA77 B76A D60A CD45 79C3 2D73 9BEA
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// in config : <parameter key="translator.class">AppBundle\Translation\TestTranslator</parameter> | |
namespace AppBundle\Translation; | |
use Symfony\Component\Translation\Translator; | |
class TestTranslator extends Translator | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
filename = 'my_file.txt' | |
filesize = os.path.getsize(filename) | |
b_read = 0 | |
f = open(filename, 'r') | |
# read n bytes and perform action | |
# ... | |
b_read += n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install php56 --with-gmp --with-homebrew-apxs --with-homebrew-curl --with-homebrew-libressl --with-homebrew-libxml2 --with-homebrew-libxslt --with-imap --with-mssql --with-postgresql --without-apache | |
==> Installing php56 from homebrew/homebrew-php | |
==> Downloading https://php.net/get/php-5.6.14.tar.bz2/from/this/mirror | |
Already downloaded: /Library/Caches/Homebrew/php56-5.6.14 | |
==> ./configure --prefix=/usr/local/Cellar/php56/5.6.14 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.6 --with-config-file-path=/us | |
==> make | |
==> make install | |
==> Caveats | |
The php.ini file can be found in: | |
/usr/local/etc/php/5.6/php.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :cachetool do | |
task :run, :command do |t, args| | |
args.with_defaults(:command => :list) | |
on release_roles(fetch(:cachetool_roles)) do | |
within fetch(:cachetool_working_dir) do | |
execute :cachetool, args[:command], *args.extras | |
end | |
end | |
end |
OlderNewer