Skip to content

Instantly share code, notes, and snippets.

View eliasdorneles's full-sized avatar

Elias Dorneles eliasdorneles

View GitHub Profile
from lxml import etree
CLASS_EXPR = "contains(concat(' ', normalize-space(@class), ' '), ' {} ')"
def has_class(context, *classes):
"""
This lxml extension allows to select by CSS class more easily
@eliasdorneles
eliasdorneles / play_song.py
Last active November 22, 2016 19:58
Challenge: guess the song by just reading the code (before playing it)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import time
VERBOSE = False
def wait(seconds):
@eliasdorneles
eliasdorneles / just_a_button.py
Last active November 26, 2015 09:07
For Those Times When You Just Want a Button
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
For those times when you just want a button.
Run and notice the new icon in your notifications area.
Inspired by: https://glyph.twistedmatrix.com/2015/07/just-a-button.html
"""