Skip to content

Instantly share code, notes, and snippets.

@immutef
immutef / TestCommand.php
Created December 10, 2011 12:56
ZeroMQ Fan In/Out + Kill
<?php
/**
* I'd like to use IPC sockets (ipc://foo.ipc) but my virtual machine won't let me ... :)
* IPC sockets will be faster than TCP, so this script could run even faster than it does!
*/
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
@jmikola
jmikola / es.sh
Created September 12, 2011 19:01 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 11.04
cd ~
sudo apt-get install unzip
sudo apt-get install python-software-properties -y
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.6.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
@havvg
havvg / bdd-experiment-guide.md
Created September 9, 2011 14:44
Behavior Driven Development in Symfony2 with Behat, Mink and Zombie.js
@ratibus
ratibus / sfSearchTask.class.php
Created September 8, 2011 14:24
symfony search task
<?php
class sfSearchTask extends sfCommandApplicationTask
{
/**
* @see sfTask
*/
protected function configure()
{
$this->addArguments(array(
@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
@ezzatron
ezzatron / clean-use.php
Created May 9, 2011 12:10
Script to clean unnecessary PHP use statements
#!/usr/bin/env php
<?php
$paths = array();
if (isset($_SERVER['argv']))
{
$paths = $_SERVER['argv'];
array_shift($paths);
if (!$paths)
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;
}
@mikhailov
mikhailov / installation.sh
Created November 23, 2010 15:18
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
@j0k3r
j0k3r / mysqlinfo.php
Created September 23, 2010 19:11 — forked from pborreli/mysqlinfo.php
mysqlinfo - A phpinfo() like for mysql
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
a { text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-family: arial, helvetica, sans-serif; font-size: 18pt; font-weight: bold;}
h2 { font-family: arial, helvetica, sans-serif; font-size: 14pt; font-weight: bold;}
body, td { font-family: arial, helvetica, sans-serif; font-size: 10pt; }
th { font-family: arial, helvetica, sans-serif; font-size: 11pt; font-weight: bold; }
@pborreli
pborreli / ProjectConfiguration.class.php
Created September 16, 2010 11:23
disable drop-db task in symfony console
<?php
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->dispatcher->connect('command.filter_options', array($this, 'filterCommandOptions'));
}
/**