Skip to content

Instantly share code, notes, and snippets.

leoblum /
Last active January 22, 2021 11:42
Make backup of emails from Gmail without 3rd-party programs, APIs, etc
import requests
import json
import os
from datetime import timedelta
from time import time
output_folder = '.data/gmail_u0'
cache_file = os.path.join(output_folder, '.cache')
os.makedirs(output_folder, exist_ok=True)
leoblum / 01-formulas
Last active January 6, 2021 21:00
Brew Top Dec 2020 (packages with more than 100 installs in 30 days)
858978 openssl@1.1 Cryptography and SSL/TLS Toolkit
852807 python@3.9 Interpreted, interactive, object-oriented programming language
746073 readline Library for command-line editing
623936 sqlite Command-line interface for SQLite
377743 glib Core application library for C
327161 nghttp2 HTTP/2 C Library
320077 libtiff TIFF library and utilities
316940 node Platform built on V8 to build network applications
313995 icu4c C/C++ and Java libraries for Unicode and globalization
299737 gdbm GNU database manager
leoblum /
Last active October 28, 2020 15:40
Extract font name from TTF file by python3 + fonttools
# python 3.8 (will work for lower versions too).
# requirements: pip3 install fonttools
import os
from contextlib import redirect_stderr
from fontTools import ttLib
def font_name(font_path):
font = ttLib.TTFont(font_path, ignoreDecompileErrors=True)