This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Context switch tracking app. | |
# Stores context switches in a local SQLite DB. | |
from datetime import datetime | |
import os | |
import sqlite3 | |
LOCAL_DIR = os.path.expanduser("~/.swapctx") | |
LOCAL_DB = os.path.join(LOCAL_DIR, "swapctx.db") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from bs4 import BeautifulSoup | |
import requests | |
def get_mais_liberdade_members(): | |
url = 'https://maisliberdade.pt/fundadores/' | |
response = requests.get(url) | |
soup = BeautifulSoup(response.content, features="html.parser") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from numbers import Number | |
from collections import Set, Mapping, deque | |
try: # Python 2 | |
zero_depth_bases = (basestring, Number, xrange, bytearray) | |
iteritems = 'iteritems' | |
except NameError: # Python 3 | |
zero_depth_bases = (str, bytes, Number, range, bytearray) | |
iteritems = 'items' |