Skip to content

Instantly share code, notes, and snippets.

@vibragiel
vibragiel / notable-absences.py
Last active December 12, 2015 08:39
This script retrieves the interlanguage links for every featured article in the English Wikipedia and prints a list of those articles not present in the Wikipedia language provided as a command line parameter. The list is sorted on the total number of interlanguage links of the articles. That is, it shows good articles present in many Wikipedias…
#/usr/bin/env python
# -*- coding: utf8 -*-
# notable-absences.py - Prints a list of featured articles in the English
# Wikipedia which are not present in the provided
# Wikipedia language, sorted by the number of
# interlanguage links of the article. That is, notable
# articles present in many Wikipedias, but not on the
# provided one.
#
# Copyright (C) 2012 Gabriel Rodríguez Alberich <[email protected]>
@vibragiel
vibragiel / multigrafias.json
Created February 6, 2013 17:21
Palabras del español que tienen varias escrituras distintas, en JSON. Albóndiga o almóndiga, cuásar o quásar, raíl o rail, faba o haba... ¡Hay más de 4000!
[
[
"abajar",
"bajar"
],
[
"abalaustrado",
"balaustrado"
],
[
@vibragiel
vibragiel / parse_papeles.py
Created February 3, 2013 15:28
Script para convertir los papeles de Bárcenas publicados por EL PAÍS a json.
# -*- coding: utf8 -*-
import re
import json
from lxml import html
try:
from urllib2 import urlopen
except ImportError:
from urllib import urlopen
PAPELES_URL = "http://elpais.com/especiales/2013/caso_barcenas/" \
@vibragiel
vibragiel / papeles_barcenas.json
Last active December 12, 2015 02:48
JSON con los papeles de Bárcenas publicados por EL PAÍS en http://elpais.com/especiales/2013/caso_barcenas/todos_los_papeles.html
[
{
"forma": "Efectivo",
"debe_unidad": "(\u00bf?)",
"debe": 8.0,
"concepto": "Saldo inicial (entrega R. N.)",
"haber": null,
"anyo": 1990,
"saldo": 8.0,
"saldo_unidad": "(\u00bf?)",
@vibragiel
vibragiel / duptools-gdrive.sh
Last active August 25, 2017 21:46 — forked from tsileo/duptools.sh
An example on how to use duplicity to perform encrypted incremental backups on Google Drive. Changes over tileo's original script: Google Drive instead of S3 as backend storage. Zenity dialogs to ask for credentials. IGNORE variable to exclude a list of directories from the backup. Verbosity raised to level 8. Activated asynchronous uploads.
#!/bin/bash
# directories to be included, space separated
SOURCE="/home/chewie /etc"
# directories to be excluded, space separated
IGNORE="/home/chewie/Downloads /home/chewie/Steam"
DRIVE_FOLDER="duplicity-backup"
LOGFILE=/home/chewie/duplicity.log
# set email to receive a backup report
EMAIL=""
@vibragiel
vibragiel / gist:3707083
Created September 12, 2012 14:40
Rate of aviation incidents per million of scheduled passengers carried (selected airlines)

Rate of aviation incidents per airline per million of scheduled passengers carried

Airline* Rate Passengers†
Air Canada 2.73 130,132,000
WestJet 1.50 59,537,000
American Airlines 1.19 389,668,313
Aeroflot 1.02 48,090,000
Swiss 0.83 57,630,000
Lufthansa 0.68 302,717,000