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
# A decorator that lets you require HTTP basic authentication from visitors. | |
# Kevin Kelley <[email protected]> 2011 | |
# Use however makes you happy, but if it breaks, you get to keep both pieces. | |
# Post with explanation, commentary, etc.: | |
# http://kelleyk.com/post/7362319243/easy-basic-http-authentication-with-tornado | |
# Usage example: | |
#@require_basic_auth | |
#class MainHandler(tornado.web.RequestHandler): |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
from __future__ import absolute_import, print_function, division, unicode_literals | |
import re | |
from collections import defaultdict, Counter | |
INITIAL_SYMBOLS = b'abc' | |
def count_fragments(lines, initial_symbols=None): |
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 python3.4 | |
import re | |
import sys | |
import os.path | |
import logging | |
import subprocess | |
from pathlib import Path | |
from six import text_type |
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
# This is my compton configuration after a quick cleanup. (It's still none too organized; sorry about that.) | |
# With this file at ~/.config/compton.conf, I can run compton without any arguments (just plain `compton`). | |
# | |
# In the hopes that explaining my software and hardware environment might be helpful to you: | |
# | |
# I use this configuration on Ubuntu 15.10 (and have used it on previous releases); I am currently using the 352.63 ("long-lived | |
# branch") NVIDIA binary drivers, installed from the Ubuntu software repositories. I use fluxbox as my window manager; most of | |
# the other components of my desktop environment are borrowed from Xfce. | |
# | |
# My workstation at home has an i7-4930K and a GTX 970 in it, which are together more than enough to drive several 4K displays |