Skip to content

Instantly share code, notes, and snippets.

View camilojd's full-sized avatar

Camilo Díaz Repka camilojd

View GitHub Profile
@camilojd
camilojd / showresults.js
Created May 27, 2018 18:00
Show twitter poll results
function obtainPollIframes() {
return Array.prototype.slice.call(document.getElementsByTagName('iframe')).filter(function(fr) {
return fr.parentElement.className.indexOf('card-type-poll4choice') != -1
})
}
function modifyPollDescriptions(iframe) {
Array.prototype.slice.call(iframe.contentDocument.getElementsByClassName('PollXChoice-choice--text')).forEach(function(tuple) {
tuple.firstChild.nextSibling.textContent = tuple.firstChild.nextSibling.textContent + ' (' + tuple.firstChild.textContent + ')'
})
@camilojd
camilojd / volar101.md
Last active May 1, 2017 14:35
Volar 101

Llegada al aeropuerto

Para vuelos internacionales es importante llegar al aeropuerto al menos 3 horas antes, a fin de hacer el despacho de las valijas.

Los pasos son:

  1. Despachar las valijas grandes para el vuelo en cuestión. Ahí nos tienen que entregar un "pase de abordaje" si es que ya no lo tenemos impreso.

  2. Ir hacia el área de "partidas" (llevando el "carry on") y dirigirnos al portón que corresponde a nuestro vuelo. Tenemos que estar seguros que estamos en la terminal adecuada para encontrar el portón que nos corresponde, ya que hay aeropuertos que tienen varias terminales (ej: Guarulhos/São Paulo). Una vez encontrado el portón que nos corresponde (que generalmente estará indicado en carteles con letras grandes) pasamos por el control de seguridad del aeropuerto. Podemos asegurar que realmente estamos en el portón correspondiente preguntando al personal de seguridad del aeropuerto si tenemos alguna duda, y probablemente nos pedirán el pase de abordaje para ayudarnos. Necesitamos tener nuestros

@camilojd
camilojd / rst_lint.py
Created May 31, 2015 14:59
Lint RSTs in a dir, generate a report
import codecs
import collections
import os
import restructuredtext_lint
import sys
## Misc functions
## tomado de http://stackoverflow.com/questions/898669/how-can-i-detect-if-a-file-is-binary-non-text-in-python
textchars = bytearray([7,8,9,10,12,13,27]) + bytearray(range(0x20, 0x100))
is_binary_string = lambda bytes: bool(bytes.translate(None, textchars))
@camilojd
camilojd / gist:64e834ca94fc18ffdbc3
Created February 5, 2015 20:11
SSA-like transformation of C# code AST using Roslyn
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
namespace AppTransforms
{