Skip to content

Instantly share code, notes, and snippets.

@ievans3024
ievans3024 / custom_log_levels.py
Last active March 22, 2018 18:32
python custom logging levels example
import logging
# keep in mind that the lower the number, the more verbose the log output
# everything greater than that number will also print
logging.DEBUG_PLUS = 5 # more verbose debug
logging.INFO_PLUS = 15 # more verbose info
logging.WARNING_PLUS = 25 # more verbose warning
logging.ERROR_PLUS = 35 # more verbose error
logging.CRITICAL_PLUS = 45 # more verbose critical
@ievans3024
ievans3024 / elapsed.py
Last active March 6, 2018 18:13
A module extending the builtin timedelta class to approximate a string representation of the time difference
import datetime
"""
A small module extending timedelta.
Provides a method to print a formatted
string detailing elapsed time in the given delta
"""
@ievans3024
ievans3024 / reddit-comment-hider.css
Last active November 4, 2019 18:46
For when you just need to prevent yourself from getting into arguments with idiots. This style hides all comment sections in all posts.
/**
* Reddit Comment Hider Userstyle
*
* by ievans3024
*
* For when you just need to prevent yourself from getting into arguments with idiots.
* This style hides all comment sections in all posts.
*/
@namespace url(http://www.w3.org/1999/xhtml);
@ievans3024
ievans3024 / reddit-gag.css
Created July 25, 2017 22:04
Reddit Gag Userstyle
/**
* Reddit Gag Userstyle
*
* by ievans3024
*
* For when you just need to prevent yourself from getting into arguments with idiots.
* This style hides all reply/submit/comment forms and links, except in existing private messages.
*/
@namespace url(http://www.w3.org/1999/xhtml);