Skip to content

Instantly share code, notes, and snippets.

Drinking mate

Hernán Rodríguez Colmeiro peregrinogris

Drinking mate
View GitHub Profile
peregrinogris /
Last active Dec 2, 2021
Custom flavored grep
grep -IiRn --exclude="$EXCLUDE" --exclude-dir="$EXCLUDEDIR" --color=$COLOR -C$CONTEXT "$1" * \
| less -iFRX
peregrinogris / GrayZone.css
Created Jul 1, 2013
My own take on GrayZone theme for LimeChat.
View GrayZone.css
html {
font: 13px/1.3em 'Lucida Grande' sans-serif;
background-color: #eee;
color: #333;
word-wrap: break-word;
margin: 0;
padding: 0;
body {
peregrinogris /
Created Aug 18, 2016
Build a leanpub book source to epub, using pandoc
with open("Book.txt") as f:
print ('echo "Starting build of {book}.epub";'
"pandoc {files} " +
"--smart --table-of-contents --chapters -o {book}.epub;"
'echo " {book}.epub created."'
).format(book="Book","\n", " "))
peregrinogris /
Last active Jul 19, 2018
Twelve Days of Christmas implementation in Rust.
fn main() {
let gifts = [
("First", "a Partridge in a Pear Tree"),
("Second", "Two Turtle Doves"),
("Third", "Three French Hens"),
("Fourth", "Four Calling Birds"),
("Fifth", "Five Gold Rings"),
("Sixth", "Six Geese a-Laying"),
("Seventh", "Seven Swans a-Swimming"),
("Eighth", "Eight Maids a-Milking"),
peregrinogris / .gvimrc
Last active May 4, 2018
Vim Config Files
View .gvimrc
set guioptions-=r
set guioptions-=L
set guicursor=a:blinkon0
set guioptions=egmrt
hi ColorColumn guibg=#3E3D32
View .bash_profile
export CLICOLOR=1
# Modifies PS1 when called (to fix line-wrapping issues)
hg_branch() {
red=$(tput setaf 1)
reset=$(tput sgr0)
branch=`hg branch 2> /dev/null | awk '{print $1}'`
if [[ -n $branch ]]; then
PS1="$PS1 \[$red\](\[$reset\]$branch\[$red\])\[$reset\]"
peregrinogris /
Created Apr 8, 2018
Updating GNU screen on Raspbian

Updating GNU screen on Raspbian

I've been frustrated for a few years that GNU screen didn't have emoji support but I just rechecked the issue... And guess what? It's fixed as of version 4.6.0!! While this is great news, the last available version in raspbian is 4.1.0, meaning that yes, we have to compile.


The steps are easy:

# name an email address in all old commits.
# WARNING: Will change all your commit SHA1s.
# Based off of the script from here:
git filter-branch -f --commit-filter '
git commit-tree "$@";
View snippets.cson
'i18n translation singular':
'prefix': 'i18'
'body': '{i18n.gettext(\'$1\')}$2'
'i18n translation plural':
'prefix': 'i18n'
'body': '{i18n.ngettext(\'$1\', \'$2\', ${3:idx})}$4'
'New test suite':
'prefix': 'newtest'
'body': """
peregrinogris / git-usebranch
Last active Feb 1, 2017
Use this to checkout a branch ending with a certain string
View git-usebranch
#!/usr/bin/env bash
branch=`git branch -a | egrep -io "([^/]+/)?[^/]+$1$" | sed 's/* //' | head -1`
git checkout $branch