Skip to content

Instantly share code, notes, and snippets.

View gcollazo's full-sized avatar

Giovanni Collazo gcollazo

View GitHub Profile
@gcollazo
gcollazo / Backbone.sync_csrftoken.js
Created September 25, 2011 14:56
This is what I did to insert the CSRF token in backbone requests. This works with django.
var oldSync = Backbone.sync;
Backbone.sync = function(method, model, options){
options.beforeSend = function(xhr){
xhr.setRequestHeader('X-CSRFToken', CSRF_TOKEN);
};
return oldSync(method, model, options);
};
From: No Importa <Tampoco@Importa.eh>
Subject: GiJoRaMa...FYI
Message Body:
Queridos Jíbaros y Ame-Ricans:
¡Que decepción!¿Donde está la información en español de su 'rich/intellectual people weekend'?
Seguimos con el complejo del jíbaro eñangotao' que solo publica en inglés la información porque
es el 'business language'. No hay respeto ni cortesía para el país que hospeda su evento.
web: python app/manage.py collectstatic --noinput; bin/gunicorn_django --workers=4 --bind=0.0.0.0:$PORT app/settings.py
public class Holas {
public static void main(String[] args) {
System.out.println("Buenas, soy un aprendiz de Java!");
}
}
puts "Hello Wolrd"
print "Hello World"
[format]
pretty=format:%C(yellow)%h%Creset -%C(red)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset
# Git info
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOUR="\[\033[0m\]"
PS1="\H:\W $YELLOW\$(parse_git_branch)$NO_COLOUR\$ "
[user]
name = Giovanni Collazo
email = gcollazo@gmail.com
[color]
interactive = true
status = true
branch = true
diff = true
[difftool "Kaleidoscope"]
cmd = ksdiff-wrapper git \"$LOCAL\" \"$REMOTE\"
{
"name":"Giovanni Collazo",
"projects":[
{
"name":"P1"
},
{
"name":"P2"
}
]