Skip to content

Instantly share code, notes, and snippets.

View pborreli's full-sized avatar

Pascal Borreli pborreli

View GitHub Profile
@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'));
}
/**
<?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; }
<h1>[?php echo <?php echo '$barfoo->getValue()' ?> ?]</h1>
// will produce
<h1><?php echo $barfoo->getValue() ?></h1>
We couldn’t find that file to show.
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;
}
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"
@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;
@pborreli
pborreli / gist:3906751
Created October 17, 2012 17:05
top 10 commands of one of my vagrant vm
cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 10
142 bin/behat
61 php
27 cd
25 sudo
22 ls
15 ps
14 export
12 Xvfb
9 pear
$ gtime php substrstrlen.php
0.43 user
0.01 system
0:00.56 elapsed
0.43 user
0.01 system
0:00.50 elapsed
0.42 user
@pborreli
pborreli / Instruction.md
Last active December 19, 2015 09:29
How to retrieve your GitHub Pull Request count using Google bigquery

Go to Google bigquery and execute the following query replacing XXX with your GitHub login