Skip to content

Instantly share code, notes, and snippets.

View wayetan's full-sized avatar

Wei Tan wayetan

  • Microsoft
  • United States
View GitHub Profile
@ktmud
ktmud / parse_email.py
Created August 17, 2017 19:34
Python 3.6 Parse Email Message
import re
import email.charset
from pathlib import Path
from glob import glob
from email import message_from_binary_file, policy
RE_QUOPRI_BS = re.compile(r'\b=20=\n')
RE_QUOPRI_LE = re.compile(r'\b=\n')
RE_LONG_WORDS = re.compile(r'\b[\w\/\+\=\n]{72,}\b')
@nickoala
nickoala / 0_python_email.md
Last active June 16, 2024 12:58
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@pcan
pcan / SelfExpiringHashMap.java
Last active April 21, 2024 14:18
SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
/*
* Copyright (c) 2019 Pierantonio Cangianiello
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@bergie
bergie / .gitignore
Created September 19, 2011 15:50
Node.js email handling examples
config.json
reading-image.png