This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rpad(txt, n, c) { | |
// padding length | |
n = n || 15; | |
// character to fill the string | |
c = c || ' '; | |
for (var p = 0, diff = n - txt.length; diff && p < diff; txt += c, p++); | |
return txt; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Instalación: Copiar y pegar en ~/.bash_profile. | |
# | |
# Cambia los colores del prompt y muestra el branch del directorio actual. | |
# | |
# Ejemplo: | |
# [ardilla:~]$ cd /usr/local/sitios/enlatele | |
# [ardilla:enlatele[v3]]$ git branch | |
# master | |
# newimporter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env/python | |
""" | |
This script is executed through the post-receive hook | |
after a git repo receives data (someone git-pushed) | |
and notifies subscribers of the event via growl. | |
depends on the netgrowl module http://the.taoofmac.com/space/projects/netgrowl | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Expand tabs in php files. | |
$ for i in $(find ./* -iname "*.php"); do awk '{sub("\t"," ",$0); print $0}' $i > ~/e.tmp && cat ~/e.tmp > $i; done |