Skip to content

Instantly share code, notes, and snippets.

View mabrizio's full-sized avatar
:octocat:
Nobody cares!

Mauricio Araya V. mabrizio

:octocat:
Nobody cares!
View GitHub Profile
@mabrizio
mabrizio / vim-tips
Last active January 2, 2016 15:39
Vim cool tips
# Remove all lines starting with the "#" character
:g/^#/d
# Show line numbers
:set number
or
:set nu
@mabrizio
mabrizio / inputrc
Last active December 30, 2015 23:39
Smart history for ¿bash?
# Agregue lo siguiente al final del /etc/inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
"\eOA": history-search-backward
"\eOB": history-search-forward
@mabrizio
mabrizio / full-text-with-postgresql.sql
Last active May 1, 2016 03:33
Full Text Search en PostgreSQL, usando un índice GIN.
--
-- La ciencia está en:
--
-- * Agregar un campo en la tabla de tipo tsvector (1), en este caso se llama tsv,
-- podría ponérsele cualquier nombre.
-- * Agregar un índice GIN (2)
-- * Crear un trigger que cuando se inserte o actualice una tupla se actualice la
-- columna tsv (nuestro tsvector)
--
-- 1. http://www.postgresql.org/docs/9.1/static/datatype-textsearch.html