Skip to content

Instantly share code, notes, and snippets.

Francesco Tassi ftassi

Block or report user

Report or block ftassi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ftassi
ftassi / appkernel.php
Created Jan 21, 2016
Move cache and log dir to shared memory
View appkernel.php
public function getCacheDir()
{
if (in_array($this->environment, array('dev'))) {
return '/dev/shm/site/cache/' . $this->environment;
}
return parent::getCacheDir();
}
public function getLogDir()
@ftassi
ftassi / form.html
Created Nov 28, 2015
Mailchimp embdedded form IT translation
View form.html
<script type='text/javascript'>
$mcj.extend($mcj.validator.messages, {
required: "Inserisci la tua email",
remote: "Correggi questo campo",
email: "Controlla l'indirizzo email",
url: "Inserisci una URL corretta",
date: "Inserisci una data corretta",
dateISO: "Inserisci una data valida (ISO).",
number: "Inserisci un numero corretto",
digits: "Inserisci solo numeri",
@ftassi
ftassi / php-cs-fixer-pre-commit.php
Last active Sep 1, 2015 — forked from mardix/php-cs-fixer-pre-commit.php
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error
View php-cs-fixer-pre-commit.php
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*
@ftassi
ftassi / bookingpage.php
Last active Aug 29, 2015
PageObjectExampleImplementation
View bookingpage.php
class BookingPage extends Page
{
public function bookAs($firstName, $lastName, $email)
{
$bookingForm = $this->find('css', 'form#booking-form');
$bookingForm->fillField('booking[firstName]', $firstName);
$bookingForm->fillField('booking[lastName]', $lastName);
$bookingForm->fillField('booking[email]', $email);
}
@ftassi
ftassi / console-listener.php
Last active Aug 29, 2015
Database sharding with doctrine
View console-listener.php
<?php
public function onConsoleCommand(ConsoleCommandEvent $event)
{
$shardManager = new PoolingShardManager($connection);
$shard = $input->getParameterOption(['--shard', '-s']);
if ('global' === $shard) {
} else {
$shardManager->selectGlobal();
$shardManager->selectShard($shard);
}
@ftassi
ftassi / FeaturesContext.php
Last active Aug 29, 2015
Snippet del post "Da TDD a BDD con Symfony2"
View FeaturesContext.php
public function cleanDatabase()
{
$container = $this->kernel->getContainer();
$registry = $container->get('doctrine');
$om = $registry->getManager();
$type = 'ORM';
$executorClass = 'Doctrine\\Common\\DataFixtures\\Executor\\' . $type . 'Executor';
$referenceRepository = new ProxyReferenceRepository($om);
View id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBAM42t0LKluYKIFiPK2j14ih+n/39iJmo8CjoIrcia2N0DiqofjXihn5VfjXpS1CQHOGGbAKDrgrjmL6yK6X7G/XrVEOnFp5sAx7wJu1CEG+JV7xOi0xl/4FxP8vY4xIMCZqCayDivfUHqx6SdhIPqx6zluhR2vbDusSmIyRkveQHAAAAFQD4CvRt68I0uOScV9hnts2HNOWHVQAAAIAsw2ZF5lBmdNTezbfA/0a07kistejsKLfxxiUeA3MLklNcd6GdXNKOq38fJM/TSXY2a5S9OwviBp5TELTGE9VCfsqbupACSlm1NtWkGUUoP1kEgXlM50W5bXRPObdiv2bct45h5hpJWJD9SyP2Iv85VLe2eKVamt1jEYoYL2zODQAAAIEAhrckDcN5JbJ5zIbz5EuhMWLn3pTrnTHK2zL4hDLXOszMiYzOSrtXK/UqAsDoJLdC8gztU5g4NQyPD/IHhV2UAMjBQJuX2+0mPtFeyZ5XYpm4vnQ6UjqwA2faoOsUrFSwtMU6V38E+T++o1JrgG+XY9eXf8+ZUV2QeTANEzTyi10= ftassi@macbook-pro-di-francesco-tassi.local
View travis-ci.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9XVvg7e8Fo1HgfK0X/bwGtgjtZMDp0YdA29OHxI73EdWk1+34NBkc+l28l/0UHyy5GsnfqZJATz6LpOsdNLlUKSODpi6QOYv91XQbKkcYDz51whYouFcmhf8l+AK7XLCiIjPzEYYV+fECSdTzaxSxvY/4OIPZpWQoEDtuDz138YBB7F2GgYkREyYGrtZxGd7cLThE2MGyjDyjBIFI7FIDLrao8uVq2diSQ932NJzz20OtRABZ8af/zts1Q+qx2JO6VunjZ2sa2QegfP7TwHlNbqpbaebcJJ3yriYr8U1rMQ8C3DBGOT58dCf776Rqh6EUmWqROvHznSDwgORmBCxN ftassi@MacBook-Pro-di-Francesco.local
View id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBAM42t0LKluYKIFiPK2j14ih+n/39iJmo8CjoIrcia2N0DiqofjXihn5VfjXpS1CQHOGGbAKDrgrjmL6yK6X7G/XrVEOnFp5sAx7wJu1CEG+JV7xOi0xl/4FxP8vY4xIMCZqCayDivfUHqx6SdhIPqx6zluhR2vbDusSmIyRkveQHAAAAFQD4CvRt68I0uOScV9hnts2HNOWHVQAAAIAsw2ZF5lBmdNTezbfA/0a07kistejsKLfxxiUeA3MLklNcd6GdXNKOq38fJM/TSXY2a5S9OwviBp5TELTGE9VCfsqbupACSlm1NtWkGUUoP1kEgXlM50W5bXRPObdiv2bct45h5hpJWJD9SyP2Iv85VLe2eKVamt1jEYoYL2zODQAAAIEAhrckDcN5JbJ5zIbz5EuhMWLn3pTrnTHK2zL4hDLXOszMiYzOSrtXK/UqAsDoJLdC8gztU5g4NQyPD/IHhV2UAMjBQJuX2+0mPtFeyZ5XYpm4vnQ6UjqwA2faoOsUrFSwtMU6V38E+T++o1JrgG+XY9eXf8+ZUV2QeTANEzTyi10= ftassi@macbook-pro-di-francesco-tassi.local
View BrowserKitDriver.php
<?php
namespace Behat\Mink\Driver;
use Symfony\Component\BrowserKit\Client,
Symfony\Component\BrowserKit\Cookie,
Symfony\Component\BrowserKit\Response,
Symfony\Component\DomCrawler\Crawler,
Symfony\Component\DomCrawler\Form,
Symfony\Component\DomCrawler\Field,
You can’t perform that action at this time.