Skip to content

Instantly share code, notes, and snippets.

View gerardorochin's full-sized avatar

Gerardo Rochín gerardorochin

View GitHub Profile
@gerardorochin
gerardorochin / bash-colors.sh
Created September 18, 2013 22:02
Color Output on Bash Scripts
#!/bin/bash
# tputcolors
echo
echo -e "$(tput bold) reg bld und tput-command-colors$(tput sgr0)"
for i in $(seq 1 7); do
echo " $(tput setaf $i)Text$(tput sgr0) $(tput bold)$(tput setaf $i)Text$(tput sgr0) $(tput sgr 0 1)$(tput setaf $i)Text$(tput sgr0) \$(tput setaf $i)"
done
@gerardorochin
gerardorochin / rfc regex
Created June 6, 2013 00:00
Expresion regular para validar RFC
/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/
@gerardorochin
gerardorochin / bootstrap_pagination.php
Created February 20, 2013 01:51
CodeIgniter Pagination Twitter Bootstrap Style
/**
* Pagination Twitter Bootstrap Style
*
* @access private
* @param records per page
* @param current page
* @param total records
* @return string
*/
private function _bootstrap_paginate($rpp='', $page='', $total=0)
@gerardorochin
gerardorochin / gitweb.nginx.conf
Last active February 8, 2018 05:01
FreeBSD gitweb.cgi config for nginx
#Git Web
location /git {
alias /usr/local/www/gitweb/;
index gitweb.cgi;
auth_basic "Git SCM";
auth_basic_user_file htpasswd;
}
location ~ ^/git/gitweb.cgi {