Skip to content

Instantly share code, notes, and snippets.

View Ph3nol's full-sized avatar
🦄
Riding a Unicorn. From ::1 to the moon.

Cédric Dugat Ph3nol

🦄
Riding a Unicorn. From ::1 to the moon.
View GitHub Profile
@Ph3nol
Ph3nol / composer.json
Created October 6, 2012 14:26 — forked from igorw/composer.json
React Chatroulette
{
"require": {
"react/socket": "0.2.*"
}
}
@Ph3nol
Ph3nol / github-autodeploy.rb
Created September 19, 2012 15:36 — forked from jeremymarc/github-autodeploy.rb
Github post-receive hook for auto-deployment of a Web site document root
require "rubygems"
require "sinatra"
require "json"
# Configure this with the directory path for the Web server's clone of the Git repo
git_dir = '/var/www/origin.git'
# Configure the mappings between Git branches and Web document roots
branch_to_working_directory = {
'www' => '/var/www/www.example.com',
@Ph3nol
Ph3nol / flush.php
Created September 15, 2012 14:43 — forked from arnaud-lb/flush.php
flush email queue from symfony command
<?php
protected function flushQueue()
{
$container = $this->getContainer();
$transport = $container->get('mailer')->getTransport();
$spool = $transport->getSpool();
$spool->flushQueue($container->get('swiftmailer.transport.real'));
@Ph3nol
Ph3nol / sf2.php
Created September 13, 2012 13:18 — forked from adrienbrault/sf2.php
sami example that includes protected/private properties/methods
<?php
use Sami\Sami;
use Sami\Version\GitVersionCollection;
use Sami\Parser\Filter\TrueFilter;
use Symfony\Component\Finder\Finder;
$iterator = Finder::create()
->files()
->name('*.php')
@Ph3nol
Ph3nol / sf2.php
Created September 10, 2012 15:09 — forked from adrienbrault/sf2.php
<?php
use Sami\Sami;
use Sami\Version\GitVersionCollection;
use Sami\Parser\Filter\TrueFilter;
use Symfony\Component\Finder\Finder;
$iterator = Finder::create()
->files()
->name('*.php')
@Ph3nol
Ph3nol / FooController.php
Created September 6, 2012 06:40 — forked from igorw/FooController.php
Silex convention-based controllers
<?php
// src/Foobar/Controller/FooController.php
namespace Foobar\Controller;
class FooController
{
public function helloAction($request)
{
@Ph3nol
Ph3nol / composer.json
Created August 27, 2012 13:24 — forked from stephpy/composer.json
composer
{
"name": "rezzza/myproject",
"description": "myproject",
"authors": [
{
"name": "Chuck norris",
"email": "chuck@norris.com"
}
],
"licence": "MIT",
@Ph3nol
Ph3nol / QSAListener.php
Created August 8, 2012 18:36 — forked from kriswallsmith/QSAListener.php
implements QSA on Symfony2 redirects
<?php
use JMS\DiExtraBundle\Annotation as DI;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
/** @DI\Service */
class QSAListener
{
private $blacklist;
@Ph3nol
Ph3nol / gist:3187434
Created July 27, 2012 11:08
array_diff ...
<?php
function array_diff_simple($a, $b)
{
$r = array();
foreach($a as $key => $val) {
if(!isset($b[$key])) {
$r[$key] = $val;
} else {
if(is_array($b[$key]) && !is_array($val)) {
@Ph3nol
Ph3nol / sphinx-macosx.sh
Created June 6, 2012 05:14 — forked from ubermuda/sphinx-macosx.sh
Installing sphinxsearch on macosx
# first sphinx
brew install sphinx
# the formula does not install libsphinxclient :/
wget http://sphinxsearch.com/files/sphinx-2.0.4-release.tar.gz
tar xzf sphinx-2.0.4-release.tar.gz
cd sphinx-2.0.4-release/api/libsphinxclient/
CXXCPP="gcc -E" ./configure --prefix=/usr/local
make
make install