Skip to content

Instantly share code, notes, and snippets.

View Ricordel's full-sized avatar

Yoann Ricordel Ricordel

View GitHub Profile
@sloanlance
sloanlance / logging_Iso8601UTCTimeFormatter.py
Last active November 25, 2021 03:28
Python: A logging Formatter class giving timestamps in a more common ISO 8601 format.
class Iso8601UTCTimeFormatter(logging.Formatter):
"""
A logging Formatter class giving timestamps in a more common ISO 8601 format.
The default logging.Formatter class **claims** to give timestamps in ISO 8601 format
if it is not initialized with a different timestamp format string. However, its
format, "YYYY-MM-DD hh:mm:ss,sss", is much less common than, "YYYY-MM-DDThh:mm:ss.sss".
That is, the separator between date and time is a space instead of the letter "T"
and the separator for fractional seconds is a comma instead of a period (full stop).
While these differences may not be strictly *wrong*, it makes the formatted timestamp
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}