Skip to content

Instantly share code, notes, and snippets.

View liuggio's full-sized avatar

Giulio De Donato liuggio

  • Radical Company
  • London
View GitHub Profile
@liuggio
liuggio / PartnerManager.php
Created February 10, 2012 14:26
phpunit-closure best practice
/**
* insert a new row into the Entity trackVisit
*
* @param int $affiliateCampainId
* @param string $ipAddress
*/
public function trackVisit($affiliateCampainId, $ipAddress)
{
$visit = new trackVisit();
$visit->setIdentifier($affiliateCampainId);
@liuggio
liuggio / Yahoo Search Marketing.js
Created March 2, 2012 15:18
Yahoo! Search Marketing
<SCRIPT language="JavaScript" type="text/javascript">
<!-- Yahoo! Search Marketing
window.ysm_customData = new Object();
window.ysm_customData.conversion = "transId=1,currency=2,amount
=3";
var ysm_accountid = "1TGFOC61CVR7IG61MK9SVDEMIDG";
document.write("<SCR" + "IPT language='JavaScript' type='text/
javascript' "
+ "SRC=//" + "qasrv1.wa.marketingsolutions.yahoo.com" +
"/script/ScriptServlet" + "?aid=" + ysm_accountid
@liuggio
liuggio / app-config-config.yml
Created April 19, 2012 12:53
Symfony2 assets on RackSpace Cloud files [config.yml, parameter.ini]
framework:
# ...
templating:
# ...
packages:
## if you want to redirect just some asset remember to add also into twig file the package='rscf'
rscf:
base_urls: [%rackspace_container_url%]
## or use the generic:
# assets_base_urls:
@liuggio
liuggio / UsingGitHubAsAssetsCloudFiles-.git-hooks-post-commit
Created April 20, 2012 08:11
symfony2 store your assets into the github
#!/bin/sh
# in you /UsingGitHubAsAssetsCloudFiles/.git/hooks/post-commit
git push origin master
@liuggio
liuggio / bulkRename.sh
Created May 24, 2012 14:57
Bulk recursive rename dirs and files
#!/bin/bash
# $1 is the var
# $2 is replace from
# $3 is replace to
EXPECTED_ARGS=3
E_BADARGS=65
HELP=$(cat <<EOF
Usage with three arguments:
`basename $0` /var/www/path/ typo type
@liuggio
liuggio / phpunit-log-junit.php
Created May 26, 2012 12:16 — forked from elazar/phpunit-log-junit.php
PHPUnit --log-junit processor
<?php
/**
* This script is used to process the output of a PHPUnit test run
* that uses --log-junit for the purposes of timing each executed
* test method. It outputs test methods with their respective
* runtimes in order from largest to smallest. Times are in
* seconds. The script accepts paths to any number of files in the
* JUnit log format.
*
* Ex: php phpunit-log-junit.php /path/to/junit-log1.xml /path/to/junit-log2.xml ...
@liuggio
liuggio / doctrine-centrilized-query.md
Created July 9, 2012 10:49
doctrine Centralized query RFC

Now:

 $query = $this->getEntityManager()
            ->createQuery(
            'SELECT s FROM AcmeDemoBundle:Service s
             WHERE  s.status = :serviceStatus
            ');
        $query->setParameter('serviceStatus', Service::STATUS_ENABLED);
@liuggio
liuggio / oneliner.sh
Created August 31, 2012 09:22
one liner PROUDLYGIDEA
# a simple user can execute a 'service php5-fpm reload'
# modify
userx ALL=(root) NOPASSWD: /usr/sbin/service php5-fpm reload, /usr/bin/setfacl
#to your /etc/sudoers be careful leave the last line empty
#apache2
userx ALL=(root) NOPASSWD: /usr/sbin/service apache2 restart, /usr/sbin/service apache2 start, /usr/sbin/service apache2 stop, /usr/bin/setfacl
#akc-grep
@liuggio
liuggio / gist:4044571
Created November 9, 2012 08:54
gem list
gem install --version 2.13.4 capistrano
gem install --version 2.1.16 capifony
gem install --version 0.2.0 capistrano-notifier
actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activesupport (3.2.8)
builder (3.0.4)
@liuggio
liuggio / software-team-manifesto.md
Last active December 9, 2015 22:39
In the chaos of the implict, the tvision team creates this document with few concepts in order to unify the coding and some basic knowledge. If you are a developer and you are in the 2013 I think that you are already proficient with this notions. Please help me to improve this document forking the gist.