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 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 /
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 /
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 /
Created Jun 27, 2016
Search for the maximum valid number in a range. Useful for scanning sequential ids and quickly (O(log(max_value))) find the maximum valid id.
class MaxSearch:
def __init__(self, max_value=2**16):
self.max_value = max_value
# Override this method with your validity check
def check_result(self, number):
def scan(self, min_=0):
max_ = self.max_value

Keybase proof

I hereby claim:

  • I am peregrinogris on github.
  • I am peregrinogris ( on keybase.
  • I have a public key ASAZc3TC420CeX5vwpJmnILCDp64CP67AIxLC-P2NISSbgo

To claim this, I am signing this object:

peregrinogris /
Created Apr 11, 2016
Configure eslint based on airbnb style guides for ES5/ES6/ES7

Install: $ npm install eslint babel-eslint eslint-config-airbnb


  "extends": "airbnb/base",
  "parser": "babel-eslint",
  "rules": {
 "max-len": [2, 80, 2, {
View pocket-links.js
View test.html
<link rel="stylesheet" href="http://localhost:3000/build.css">
<!-- <script src=""></script> -->
<select id="timezone" name="timezone" class="select-control"><option value="America/Sao_Paulo">Brasilia</option></select>
<input type=reset>
<script type="text/javascript">
var select = document.createElement('select');