Skip to content

Instantly share code, notes, and snippets.

@leoblum
leoblum / download_gmail.py
Last active Jan 22, 2021
Make backup of emails from Gmail without 3rd-party programs, APIs, etc
View download_gmail.py
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
leoblum / 01-formulas
Last active Jan 6, 2021
Brew Top Dec 2020 (packages with more than 100 installs in 30 days)
View 01-formulas
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
leoblum / font_name.py
Last active Oct 28, 2020
Extract font name from TTF file by python3 + fonttools
View font_name.py
# 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)