Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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 / 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 <chewie@gmail.com>
@vibragiel
vibragiel / 350_exim4-config_vdom_aliases
Created July 3, 2013 18:14
Fichero router para exim4, a colocar en /etc/exim4/conf.d/router, para permitir dominios y usuarios de correo virtuales. Dentro de /etc/mail/virtual/ hay que crear un fichero por cada dominoi, y dentro los alias de correo que se mapean a usuarios locales.
router_virtualdomains:
driver = redirect
domains = dsearch;/etc/mail/virtual
data=${lookup{$local_part}lsearch*{/etc/mail/virtual/$domain}}
no_more
@vibragiel
vibragiel / notify.py
Last active November 3, 2020 10:56
Desktop file for WeeChat. Place it in ~/.local/share/applications. The --class parameter and StartupWMClass key allow WeeChat to have a proper icon separated from gnome-terminal (e.g. in the Unity launcher). Also included the notify.py plugin to make the icon vibrate when mentioned.
# Author: lavaramano <lavaramano AT gmail DOT com>
# Improved by: BaSh - <bash.lnx AT gmail DOT com>
# Ported to Weechat 0.3.0 by: Sharn - <sharntehnub AT gmail DOT com)
# This Plugin Calls the libnotify bindings via python when somebody says your nickname, sends you a query, etc.
# To make it work, you may need to download: python-notify (and libnotify - libgtk)
# Requires Weechat 0.3.0
# Released under GNU GPL v2
#
# 2010-02-20, Aron Griffis <agriffis@n01se.net>
# version 0.0.5: Add nick_separator, don't call show_notification twice on

Keybase proof

I hereby claim:

  • I am vibragiel on github.
  • I am gabi (https://keybase.io/gabi) on keybase.
  • I have a public key whose fingerprint is E358 7EB7 117D 9455 F198 1F2F 35C3 BEEA 4D1D 5421

To claim this, I am signing this object:

@vibragiel
vibragiel / emoticons_bookmarklet.md
Last active August 29, 2015 13:58
Bookmarklet to show handy copyable emoticons. External maintained version.

#Look Of Disapproval bookmarklet

This bookmarklet shows the look of disapproval emoticon, plus a bunch of other handy ones. It's based on maciak's bookmarklet, but uses an alert() instead.

Create a bookmark in your bookmarks toolbar and paste the following code into the URL/Location field:

javascript: (function () {
  var jsCode = document.createElement('script');
  jsCode.setAttribute('src', 'https://gist.githubusercontent.com/vibragiel/10368913/raw/ae08f049ae42bfd7394eb87dbcf8b4e0dff38f67/showEmoticos.js');
 document.body.appendChild(jsCode);