Skip to content

Instantly share code, notes, and snippets.

View ecoleman's full-sized avatar

Eric Coleman ecoleman

View GitHub Profile
Logfile of Trend Micro HijackThis v2.0.3 (BETA)
Scan saved at 4:03:51 PM, on 1/11/2010
Platform: Windows Vista SP1 (WinNT 6.00.1905)
MSIE: Internet Explorer v7.00 (7.00.6001.18349)
Boot mode: Normal
Running processes:
C:\Windows\system32\Dwm.exe
C:\Windows\system32\taskeng.exe
C:\Windows\Explorer.EXE
#!/usr/bin/env php
<?php
/**
* Usage:
* pdepend --jdepend-xml=/tmp/jdepend.xml /path/to/source
*
* ./dependencies.php /tmp/jdepend.xml -o /tmp/jdepend.svg
*/
class Dependencies
{
#!/bin/bash
echo "This is intended as a guideline only!"
if [ -e /etc/debian_version ]; then
APACHE="apache2"
RC_COMMAND="/etc/init.d/$APACHE"
elif [ -e /etc/redhat-release ]; then
APACHE="httpd"
RC_COMMAND="/etc/init.d/$APACHE"
elif [ -e /etc/arch-release ]; then
APACHE="httpd"
@ecoleman
ecoleman / gist:1525027
Created December 27, 2011 20:26
hide php variables in tagbar.vim
let g:tagbar_type_php = {
\ 'ctagstype' : 'php',
\ 'kinds' : [
\ 'i:interfaces',
\ 'c:classes',
\ 'd:constant definitions',
\ 'f:functions',
\ 'j:javascript functions:1'
\ ]
# Associate an alias mapping for the 'fake' fcgi call.
Alias /php5.fcgi /var/www/php5.fcgi
# Assign the 'fake' fcgi to call to an 'external' FastCGI Server
FastCGIExternalServer /var/www/php5.fcgi -flush -host 127.0.0.1:9000
# Create the handler mappings to associate PHP files with a call to '/php5.fcgi'
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5.fcgi
@ecoleman
ecoleman / gist:2646936
Created May 9, 2012 17:25
Sort JS Array based on another arrays positions
var positions = ['id1', 'id3', 'id2'];
var data = [{'id' : 'id1'}, {'id': 'id2'}, {'id': 'id3'}];
var sorted = data.sort(function(a, b) {
var a_pos = positions.indexOf(a.id);
var b_pos = positions.indexOf(b.id);
if (a_pos === b_pos)
return 0;
{
"require": {
"symfony/symfony": "dev-master"
, "symfony/swiftmailer-bundle": "dev-master"
, "symfony/monolog-bundle": "dev-master"
, "doctrine/common": "2.2.*"
, "doctrine/dbal": "2.2.*"
, "doctrine/orm": "2.2.*"
<?php
namespace Blank\FunkyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Blank\FunkyBundle\Entity\Product
*
* @ORM\Table()
Call Stack
# Time Memory Function Location
1 0.0002 247888 {main}( ) ../app_dev.php:0
2 0.0258 3356480 Symfony\Component\HttpKernel\Kernel->handle( ) ../app_dev.php:29
3 0.0910 9178872 Symfony\Bundle\FrameworkBundle\HttpKernel->handle( ) ../bootstrap.php.cache:575
4 0.0910 9180624 Symfony\Component\HttpKernel\HttpKernel->handle( ) ../classes.php:5699
5 0.0910 9180688 Symfony\Component\HttpKernel\HttpKernel->handleRaw( ) ../classes.php:4829
6 0.4017 21309184 call_user_func_array ( ) ../classes.php:4865
7 0.4017 21309520 Blank\ContactBundle\Controller\Backend\NewPersonController->getPersonAction( ) ../classes.php:4865
8 0.4141 21583752 JMS\SerializerBundle\Serializer\Serializer->serialize( ) ../NewPersonController.php:35
<?php
namespace My\UserBundle\Form;
use My\ContactBundle\Form\BasicPersonType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class UserType extends AbstractType
{