Skip to content

Instantly share code, notes, and snippets.

View pborreli's full-sized avatar

Pascal Borreli pborreli

View GitHub Profile
@pborreli
pborreli / gist:1378477
Created November 19, 2011 05:20
one line script to build all version of php installed with php-build
for VERSION in $(ls $HOME/.phpenv/versions/); do php-build $VERSION $HOME/.phpenv/versions/$VERSION; done;
ruby-1.9.2-p0 adella:benchmarks$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0]
ruby-1.9.2-p0 adella:benchmarks$ php -v
PHP 5.3.3 (cli) (built: Aug 22 2010 19:41:55)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
ruby-1.9.2-p0 adella:benchmarks$ cat foo.rb
msg = "Hello world"
server {
expires 1M;
listen 80;
root /var/www/vhosts/sociallynotable.com/socially-notable/web;
index index.php;
if ($host ~* ^www.(.*)) {
set $remove_www $1;
rewrite ^(.*)$ http://$remove_www$1 permanent;
}
We couldn’t find that file to show.
<h1>[?php echo <?php echo '$barfoo->getValue()' ?> ?]</h1>
// will produce
<h1><?php echo $barfoo->getValue() ?></h1>
<?php
mysql_connect('localhost', 'root', '') or
die('cannot connect : ' . mysql_error());
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
body { font-family: arial, helvetica, sans-serif; font-size: 10pt; margin: 0; }
table { border-collapse: collapse; margin: auto; }
@pborreli
pborreli / ProjectConfiguration.class.php
Created September 16, 2010 11:54
force drop of one specific database symfony
<?php
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->dispatcher->connect('command.filter_options', array($this, 'filterCommandOptions'));
}
/**
@pborreli
pborreli / ProjectConfiguration.class.php
Created September 16, 2010 11:23
disable drop-db task in symfony console
<?php
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->dispatcher->connect('command.filter_options', array($this, 'filterCommandOptions'));
}
/**
@pborreli
pborreli / Configuration.class.php
Created September 14, 2010 18:29
how to remove "with_empty" checkbox for all generated formFilters in symfony 1.4
<?php
class xxxConfiguration extends sfXxxConfiguration
{
public function setup()
{
$this->dispatcher->connect('command.filter_options', array($this, 'filterCommandOptions'));
}
@pborreli
pborreli / Configuration.class.php
Created September 13, 2010 16:12
how to replace a specific widget by another for all generated forms in symfony
<?php
class xxxConfiguration extends sfXxxConfiguration
{
public function setup()
{
$this->dispatcher->connect('command.filter_options', array($this, 'filterCommandOptions'));
}