Skip to content

Instantly share code, notes, and snippets.

View xthiago's full-sized avatar

Thiago Rodrigues (xthiago) xthiago

View GitHub Profile
# inspired from http://nathanhoad.net/how-to-meld-for-git-diffs-in-ubuntu-hardy
# and http://gitguru.com/2009/02/22/integrating-git-with-a-visual-merge-tool/
sudo apt-get install meld
# create a python script with the below content and name it diff.py
#!/usr/bin/python
@xthiago
xthiago / AppKernel.php
Last active August 29, 2015 14:13 — forked from merk/AppKernel.php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
// ....
protected function getKernelParameters()
<?php
class LayoutExtension extends \Twig_Extension
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'yolo';
<?php
namespace My\Custom\Doctrine2\Function;
/**
* RandFunction ::= "RAND" "(" ")"
*/
class Rand extends FunctionNode
{
public function parse(\Doctrine\ORM\Query\Parser $parser)
@xthiago
xthiago / .bashrc
Created April 23, 2014 11:21 — forked from git-cd/.bashrc
PS1='\[\033[0;37m\][\t]\[\033[0;32m\][\u]\[\033[31m\][\h]`git branch 2>/dev/null | grep \* | head -1 | sed "s/\* //g" | awk "{ print \"[ \"\\\$1 \" ]\" }"` \[\033[1;33m\]\w\a\[\033[0m\]\n\$ '
Vagrant::Config.run do |config|
config.vm.customize do |vm|
vm.name = "PHP dev"
vm.memory_size = 512
end
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu32"
# Assign this VM to a host only network IP, allowing you to access it
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@xthiago
xthiago / README.md
Created December 8, 2013 13:35 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/