Skip to content

Instantly share code, notes, and snippets.

Avatar

Pascal Borreli pborreli

  • Les-Tilleuls.coop
  • Oujda, Morocco
  • Twitter @pborreli
View GitHub Profile
View strpos.php
$ 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 / 01_requirements.sh
Last active Dec 5, 2019
All you need to generate timelapse video of a github project development activity like : http://www.youtube.com/watch?v=nY1j3O4nWDI&hd=1
View 01_requirements.sh
brew install gource
brew install ffmpeg
@pborreli
pborreli / gist:3906751
Created Oct 17, 2012
top 10 commands of one of my vagrant vm
View gist:3906751
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
@pborreli
pborreli / gist:1378477
Created Nov 19, 2011
one line script to build all version of php installed with php-build
View gist:1378477
for VERSION in $(ls $HOME/.phpenv/versions/); do php-build $VERSION $HOME/.phpenv/versions/$VERSION; done;
View gist:900098
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"
View gist:801328
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.
View example.php
<h1>[?php echo <?php echo '$barfoo->getValue()' ?> ?]</h1>
// will produce
<h1><?php echo $barfoo->getValue() ?></h1>
View mysqlinfo.php
<?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 Sep 16, 2010
force drop of one specific database symfony
View ProjectConfiguration.class.php
<?php
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->dispatcher->connect('command.filter_options', array($this, 'filterCommandOptions'));
}
/**