Skip to content

Instantly share code, notes, and snippets.

<?php
protected function login($client, $username = 'admin@dddd.it', $password = 'admin')
{
$crawler = $client->request('get', '/admin/login')->selectButton('Login');
$form = $crawler->form();
$form['_username'] = $username;
$form['_password'] = $password;
$client->submit($form);
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/ "
}
PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[01;33m\]$(parse_git_branch)\[\033[0m\]\$ '
export PS1
<?php
class sfCommentFormFilter extends BasesfCommentFormFilter
{
public function configure()
{
$this->widgetSchema['author'] = new sfWidgetFormFilterInput();
$this->validatorSchema['author'] = new sfValidatorPass(array('required' => false));
}
@cirpo
cirpo / gist:1950346
Created March 1, 2012 15:06
git PS1
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/ "
}
PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[01;33m\]$(parse_git_branch)\[\033[0m\]\$ '
export PSI
@cirpo
cirpo / gist:1638981
Created January 19, 2012 09:37 — forked from fabiofabbrucci/gist:1638978
Vhost syfony2
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "/var/www/Symfony/web/"
ServerName symfony
<Directory "/var/www/Symfony/web/">
Options All Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
AllowOverride all
@cirpo
cirpo / gist:1638980
Created January 19, 2012 09:37 — forked from fabiofabbrucci/gist:1638978
Vhost syfony2
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "/var/www/Symfony/web/"
ServerName symfony
<Directory "/var/www/Symfony/web/">
Options ExecCGI FollowSymLinks Includes MultiViews
AllowOverride All
Allow from all
</Directory>
$('document').ready(function(){
var usernames = ['cirpo',
'merissimissima',
'unlucio',
'sandropaganotti',
'odracci',
'gandellinux',
'pcamoz',
'idonghee',
@cirpo
cirpo / gist:1207346
Created September 9, 2011 21:09
doctrine transaction in the action
<?php
$con = Doctrine_Manager::connection();
try
{
$con->beginTransaction();
$auction->extendExpirationTime();
$auction->incrementActualValue();
var intervalKey;
var over = true;
$('#next').hover(
function(e)
{
over = true;
var move = function(){
if(over){
var p = '' + $('#event_block ul').position().left - 50 + '';
imports:
- { resource: parameters.ini }
- { resource: security.yml }
framework:
charset: UTF-8
error_handler: null
csrf_protection:
enabled: true
secret: %csrf_secret%