Skip to content

Instantly share code, notes, and snippets.

View kelleyk's full-sized avatar

Kevin Kelley kelleyk

  • San Francisco, CA
View GitHub Profile
@kelleyk
kelleyk / compton.conf
Last active September 19, 2023 12:36
# 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
@kelleyk
kelleyk / venv_support_update.py
Last active August 29, 2015 14:21
Update the wheels that are used to install pip and setuptools in each newly-created virtualenv
#!/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
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):
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@kelleyk
kelleyk / tornado_basic_auth.py
Created July 9, 2011 15:51
A simple decorator that makes a RequestHandler prompt for basic auth username and password
# A decorator that lets you require HTTP basic authentication from visitors.
# Kevin Kelley <kelleyk@kelleyk.net> 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):