Skip to content

Instantly share code, notes, and snippets.

View desarrolla2's full-sized avatar
💭
Team Manager and Developer | PHP | Symfony.

Daniel González desarrolla2

💭
Team Manager and Developer | PHP | Symfony.
View GitHub Profile
<?php
namespace Mocks;
use Doctrine\DBAL\Driver\Statement;
/**
* Doctrine DBAL Statement implementing \Iterator.
*
* This class has been created because of a bug in PHPUnit Mock Objects.
# File: /etc/bash.bashrc
# System-wide .bashrc file for interactive bash(1) shells.
# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.
# If not running interactively, don't do anything
if [[ -z "$PS1" ]]; then
@desarrolla2
desarrolla2 / gist:1816237
Created February 13, 2012 11:40 — forked from COil/gist:1780897
Update Symfony2 script
#!/bin/bash
clear;
echo "> Update Symfony2 by getting the last vendors files and additional deps"
date
# Testing arguments
EXPECTED_ARGS=1
E_BADARGS=65
if [ $# -ne $EXPECTED_ARGS ]
then
@desarrolla2
desarrolla2 / Rand.php
Created November 28, 2011 11:39 — forked from Ocramius/Rand.php
MySQL RAND() function in Doctrine2 DQL
<?php
namespace My\Custom\Doctrine2\Function;
/**
* RandFunction ::= "RAND" "(" ")"
*/
class Rand extends FunctionNode
{
public function parse(\Doctrine\ORM\Query\Parser $parser)
@desarrolla2
desarrolla2 / .bashrc
Created September 16, 2011 11:36 — forked from henrik/.bashrc
Git branch and dirty state in Bash prompt.
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ '