Skip to content

Instantly share code, notes, and snippets.

View immutef's full-sized avatar

immutef

  • SCAYLE GmbH
  • Hamburg, Germany
View GitHub Profile
@defunkt
defunkt / installing-Mustache.tmbundle.md
Created March 6, 2010 10:27
Installing Mustache.tmbundle
/**
* Generating 1.000.000 solar systems (3 iterations).
* Chances for a 6 star solar system are fairly small.
* Only one solar system with 6 stars out of 3 million.
*
* #1st
* 1 Star : 732724
* 2 Stars: 234559
* 3 Stars: 30955
* 4 Stars: 1728
@jwage
jwage / Doctrine MongoDB ODM Tail Cursor Command Daemon
Created February 6, 2011 00:01
This is a Symfony2 Doctrine MongoDB ODM Tail Cursor console command. It can be ran as a daemon and it will tail a mongodb collection with a tailable cursor and process the documents with a given service as the "processor". You must specify the document, t
<?php
namespace MyCompany\Bundle\MyBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\Request;
<?php
namespace MyApp\MyBundle\Session;
use Symfony\Component\Security\Core\User\AccountInterface;
class MemcachedSessionRegistryStorage implements SessionRegistryStorageInterface
{
protected $memcached;
@craigmarvelley
craigmarvelley / Web.config
Created May 8, 2011 20:36
Silex IIS Web.config
<?xml version="1.0"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
</files>
</defaultDocument>
@kbond
kbond / build.xml
Created May 10, 2011 14:23
Symfony2 ant build script template
<?xml version="1.0" encoding="UTF-8" ?>
<project name="[PROJECT_NAME]" default="build" basedir=".">
<property environment="env"/>
<loadfile property="version" srcfile="${basedir}/VERSION"/>
<condition property="bat" value=".bat" else="">
<os family="windows" />
</condition>
<target name="test">
<delete dir="${basedir}/build"/>
@beberlei
beberlei / ActiveEntity.php
Created June 19, 2011 11:11
Doctrine 2.2 Traits Preview
<?php
use Doctrine\ORM\EntityManager,
Doctrine\ORM\Configuration,
Doctrine\ORM\Mapping\ClassMetadata;
/**
* Active Entity trait
*
* Limitations: a class can only ever be assocaited with ONE active entity manager. Multiple entity managers
@evansd
evansd / postinstall.sh
Created June 28, 2011 21:30
postinstall sript from vagrant example box (having it somewhere web-accessible is easiest way to get it on to newly created VMs)
# Apt-install various things necessary for Ruby, guest additions,
# etc., and remove optional things to trim down the machine.
apt-get -y update
apt-get -y remove apparmor
apt-get -y install linux-headers-$(uname -r) build-essential
apt-get -y install zlib1g zlib1g-dev libxml2 libxml2-dev libxslt-dev libssl-dev openssl libreadline5-dev
apt-get clean
# Remove this file to avoid dhclient issues with networking
rm -f /etc/udev/rules.d/70-persistent-net.rules
@AsaAyers
AsaAyers / crowd.php
Created July 31, 2011 00:17
PHP Crowd Authentication
<?php
/**
* This file demonstrates using Atlassian Crowd for Single Sign On.
*/
$crowd_app_name = 'REMOVED';
$crowd_app_password = 'REMOVED';
$crowd_url = 'http://crowd.REMOVED.com/crowd/services/SecurityServer?wsdl';
// http://pear.php.net/package/Services_Atlassian_Crowd
@henrikbjorn
henrikbjorn / phpunit.watchr
Created August 17, 2011 13:33
Save this in your project root and launch with the watchr gem `watchr phpunit.watchr`. This will now watch every test file for all bundles in src for changes and if a change is found it will run `phpunit -c app changedfile`
$ gem install watchr
$ cd /path/to/symfony-project
$ wget https://raw.github.com/gist/1151531/f12b125fed843086c05377d4f76185797121cbc6/phpunit.watchr
$ watchr phpunit.watchr