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
@peterhost
peterhost / node_debian_init.sh
Created November 25, 2010 11:41
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@ludofleury
ludofleury / sdzDoctrineGenerateMigrationsDiffTask.php
Created March 22, 2011 11:25
Custom migrations using schema.yml revision.
<?php
class sdzDoctrineGenerateMigrationsDiffTask extends sfDoctrineBaseTask
{
/**
* @see sfTask
*/
protected function configure()
{
$this->addOptions(array(
@jmikola
jmikola / SecurityLastActivityListener.php
Created November 11, 2011 21:12
Custom Symfony2 Voter for recent-activity and has-password security checks
<?php
namespace Acme\DemoBundle\Listener;
use Acme\DemoBundle\Security\Authorization\Voter;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
<?php
namespace FooBar\FooBundle\Security\Authorization\Voter;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
/**
* @author Henrik Bjornskov <henrik@bjrnskov.dk>
@saetia
saetia / gist:1623487
Last active July 16, 2024 05:56
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@moul
moul / 100 - OSX Desktop.markdown
Last active October 3, 2015 17:07
OSX Fresh Install

How I setup my machine after a fresh install

Download and Install Applications

  1. Xcode or Command Line Tools
  2. Install Dropbox
  3. Install 1Password
  4. Download Chrome
  • Set up Filevault
@jbeduya
jbeduya / php54_php53_pear_macports.markdown
Created June 7, 2012 22:57 — forked from raphaelstolt/php54_php53_pear_macports.markdown
Installing PHP 5.4 and 5.3 side by side on Max OSX via MacPorts

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules

@kriswallsmith
kriswallsmith / QSAListener.php
Created August 8, 2012 18:23
implements QSA on Symfony2 redirects
<?php
use JMS\DiExtraBundle\Annotation as DI;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
/** @DI\Service */
class QSAListener
{
private $blacklist;