Skip to content

Instantly share code, notes, and snippets.

<?php
class Position {
private $compass;
private $x;
private $y;

Keybase proof

I hereby claim:

  • I am sylvainfilteau on github.
  • I am sylvainfilteau (https://keybase.io/sylvainfilteau) on keybase.
  • I have a public key ASBaY8bhDmknDKMlqA-4276n5NT63loLHnIKWaY5_fa-8wo

To claim this, I am signing this object:

@sylvainfilteau
sylvainfilteau / PhpDocumentor2Task.php
Created March 5, 2014 00:54
Segmentation fault with php-5.6.0alpha3
<?php
/*
* $Id: 771693f19339f360de003104259b6e301243f7d7 $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@sylvainfilteau
sylvainfilteau / link_dump.md
Last active December 29, 2015 11:38
Link dump of my browsers tabs I keep open to read sometime (looks more like never)
@sylvainfilteau
sylvainfilteau / get_ip_from_apt_source_list.sh
Last active December 28, 2015 01:19
Getting all IP addresses related to APT source host
grep -shri "^deb" /etc/apt | cut -d " " -f 2 | sort -u | sed -e 's;https\?://;;' | sed -e 's;/.*$;;' | xargs dig +short | sort -u
@sylvainfilteau
sylvainfilteau / RemoveFilteredTableEventSubscriber.php
Created March 16, 2013 20:26
Replace the orm:schema-tool:update command from Doctrine 2 with UpdateCommand.php. It will allow you to ignore table starting with B_ (see bootstrap file)
<?php
namespace Comet\Event\Subscriber;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Tools\ToolEvents;
use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs;
class RemoveFilteredTableEventSubscriber implements EventSubscriber {
@sylvainfilteau
sylvainfilteau / gist:4279342
Created December 13, 2012 20:03
Randomize players
<?php
$players = array('cedric', 'mathieu', 'sylvain', 'christian');
shuffle($players);
var_dump($players);
@sylvainfilteau
sylvainfilteau / gist:4001608
Created November 2, 2012 14:16
Fonts available on CentOS 5.8
Bitstream Vera Sans
Bitstream Vera Sans Mono
Bitstream Vera Serif
DejaVu LGC Sans
DejaVu LGC Sans Condensed
DejaVu LGC Sans Light
DejaVu LGC Sans Mono
DejaVu LGC Serif
DejaVu LGC Serif Condensed
Dialog
@sylvainfilteau
sylvainfilteau / gist:3952812
Created October 25, 2012 14:21
Deny access to everything but a file type
<Directory /vagrant>
AllowOverride None
Order allow,deny
deny from all
</Directory>
<FilesMatch .jasper$>
Order allow,deny
allow from all
</FilesMatch>
@sylvainfilteau
sylvainfilteau / gist:3906935
Created October 17, 2012 17:38
Find number of occurence of the word "class" in php file in the "tests" directory
find tests -iname "*.php" | xargs grep "class" | sort | cut -f 1 -d : | uniq -c | sort -n -r