Skip to content

Instantly share code, notes, and snippets.

View rkmax's full-sized avatar

Julian Reyes Escrigas rkmax

View GitHub Profile
@rkmax
rkmax / git_config.sh
Created March 2, 2011 05:32
Configuración básica de GIT & Aliases
#!/bin/bash
git config --global color.ui auto
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.cl clone
git config --global alias.fe fetch
git config --global alias.me merge
git config --global alias.ca "commit -a"
<?php
protected function _editAction(Post $post)
{
$em = $this->get('doctrine.orm.default_entity_manager');
$factory = $this->get('form.factory');
$form = $factory->create(new PostFormType());
$form->setData($post);
if ($this->get('request')->getMethod() === 'POST') {
@rkmax
rkmax / ComponentLoader.js
Created April 8, 2011 20:49
Cargador de componententes Extjs via Ajax
Ext.namespace('Ext.ux');
/**
* @class Ext.ux.ComponentLoader
* @author Aaron Conran
* Provides an easy way to load components dynamically. If you name these components
* you can use Ext.ComponentMgr's onAvailable function to manipulate the components
* as they are added.
* @singleton
*/
@rkmax
rkmax / .bashrc
Created April 11, 2011 03:45
show Git branch with color and only name the folder
function git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
PS1='\[\033[0;37m\][\[\033[01;36m\]\W\[\033[0;37m\]] \[\033[0;32m\]$(git_branch)\[\033[00m\]\$ '
{
xtype: 'tabpanel',
activeTab: 0,
width: 300,
height: 335,
margins: '{all: 5}',
id: 'campos',
lazyRender: true,
items: [],
listeners: {
@rkmax
rkmax / ping_pong.erl
Created December 8, 2011 14:34
Ejemplo de mensajes entre procesos
-module(ping_pong). % Nombre del modulo
-compile(export_all). % Esto hace todas las funciones publicas fuera del modulo
ping(0, Pong_PID) ->
Pong_PID ! finished,
io:format("ping finished~n", []);
ping(N, Pong_PID) ->
Pong_PID ! {ping, self()},
receive
pong ->
@rkmax
rkmax / install-r15b.sh
Created December 14, 2011 20:59 — forked from ramgole/install-r14b04.sh
Script to install Erlang R15B (tested on a fresh Ubuntu 11.10 install)
# You will need to make this file executable (chmod u+x) and run it with sudo
apt-get -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
mkdir -p /src/erlang
cd /src/erlang
wget http://www.erlang.org/download/otp_src_R15B.tar.gz
tar -xvzf otp_src_R15B.tar.gz
chmod -R 777 otp_src_R15B
cd otp_src_R15B
./configure
make
@rkmax
rkmax / behat-jenkins.txt
Created January 23, 2012 15:33 — forked from robo47/behat-jenkins.txt
Behat, Symfony2, Jenkins
Ant-Task which runs behat:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Foo" default="build" basedir=".">
....
<target name="behat">
<exec dir="${basedir}/" executable="php" failonerror="true">
@rkmax
rkmax / vmadmin.sh
Created January 31, 2012 15:34
Admin VM on VirtualBOx
#!/bin/bash
VM_CMD=VBoxManage
VM_NAME=$2
usage() {
C_NAME=`basename $0`
cat << EOF
VMadmin Utility
@rkmax
rkmax / gsgl-sandbox.html
Created February 1, 2012 18:58
Para realizar pruebas sobre el lenguaje GSGL
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>GLSL Sandbox</title>
<meta charset="utf-8">
<style>
body {
background-color: #000000;