- Live slides
- Use and arrow keys to step through
- Video of talk from Pycon 2013
- I had the pleasure of giving this talk at Pycon 2013 in a slightly shorter form.
- Presentation markdown source
- Links to repository with actual markdown source that is used for HTML5 slides
- Landslide
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# NOTE: Idea for this script came from: | |
# spotify-export (https://github.com/jlund/spotify-export) | |
# To install/setup | |
# pip install -r requirements.txt | |
# python export.py <file> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import logging | |
def get_logger_memory_footprint(): | |
""" | |
Get tuple of (logger names, size in KB) | |
""" | |
loggers = logging.Logger.manager.loggerDict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import contextlib | |
@contextlib.contextmanager | |
def mock_attr(object_, orig_attr_name, mock_attr): | |
""" | |
Temporarily mock object attribute for testing | |
This is similiar to the unittest.patch.object in Python 3.3 just much | |
simpler for our limited needs and use in Python 2.7. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
import sys | |
import pstats | |
stats = pstats.Stats(sys.argv[1]) | |
stats.strip_dirs() | |
stats.sort_stats('cumulative') | |
stats.print_stats() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def debug_signals(cls): | |
""" | |
Attach to all available signals in decoratored class and print debug | |
message each time one of the signals is emitted. | |
""" | |
from PyQt4 import QtCore | |
def stripArgsFromSignature(signature): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# --------------------------------------------------------------------------- | |
# OO support functions | |
# Kludged by Pim van Riezen <pi@madscience.nl> | |
# http://lab.madscience.nl/oo.sh.txt | |
# --------------------------------------------------------------------------- | |
DEFCLASS="" | |
CLASS="" | |
THIS=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pskb_website/static/css/base.css b/pskb_website/static/css/base.css | |
index 519b677..30dfec1 100644 | |
--- a/pskb_website/static/css/base.css | |
+++ b/pskb_website/static/css/base.css | |
@@ -588,7 +588,6 @@ a:hover.emphasize-dark { | |
} | |
#article pre, #article blockquote, #article form { | |
- margin-left: 21px; | |
word-wrap: break-word; |