Skip to content

Instantly share code, notes, and snippets.

@AlbertoEAF
AlbertoEAF / gmail_mbox_parser.py
Last active September 29, 2023 18:27 — forked from benwattsjones/gmail_mbox_parser.py
Extension of gmail_mbox_parser.py to parse GMail's Google Takeout exports in .mbox format and do clustering analysis of senders so you can quickly triage which kind of information sources might no longer be relevant. It also adds command line arguments and exports the sender's statistics in a .csv file.
#! /usr/bin/env python3
# ~*~ utf-8 ~*~
# About: Extension of gmail_mbox_parser.py to parse GMail's Google Takeout exports in .mbox format and do clustering analysis of senders so you can quickly triage which kind of information sources might no longer be relevant. It also adds command line arguments and exports the sender's statistics in a .csv file.
# Based on https://gist.github.com/benwattsjones/060ad83efd2b3afc8b229d41f9b246c4 but expanded to add command line arguments, do clustering of senders and export a .csv with those statistics.
import re
import argparse
import mailbox
from collections import Counter
@AlbertoEAF
AlbertoEAF / fix_xiaomi_soundrecorder_mp3_dates.py
Created February 19, 2022 20:01
Fixes the modification dates of mp3's downloaded from Xiaomi's soundrecorder app.
# Author: Alberto Ferreira
# Date: 2022
# License: Free for public use. Use at your own risk.
#
# About:
#
# If you download mp3s from Xiaomi Cloud in the sound recorder app, their dates will show up as
# the date of download instead of the date shown in the app.
#
# This script fixes the mp3 modification dates to match the correct dates stored and visible in the app.
@AlbertoEAF
AlbertoEAF / profile_single_row_predict.cpp
Last active January 16, 2021 23:19
LightGBM single row predict benchmark script
/**
*
* Quick & dirty Single Row Predict benchmark.
*
*
* Add this .cpp to a new "profiling/" folder and the following line to the end of CMakeLists.txt:
*
* OPTION(BUILD_PROFILING_TESTS "Set to ON to compile profiling executables for development and benchmarks." OFF)
* if(BUILD_PROFILING_TESTS)
* # For profiling builds with valgrind/callgrind use -DUSE_DEBUG=ON