Skip to content

Instantly share code, notes, and snippets.

View simonhayward's full-sized avatar

Simon Hayward simonhayward

View GitHub Profile
@simonhayward
simonhayward / rc.lua
Created November 16, 2011 12:03
awesome wm config
-- Standard awesome library
require("awful")
require("awful.autofocus")
require("awful.rules")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
require("vicious")
-- Load Debian menu entries
@simonhayward
simonhayward / execute-file-if-modified.py
Created September 26, 2011 16:42
Run command + script as I make changes to file
import os
import sys
import subprocess
import time
def file_is_modified(filename):
""" Accepts & returns filename if it has been modified """
previous_st_mtime = 0
while True:
st_mtime = os.stat(filename)[8]
@simonhayward
simonhayward / matrix-least-recently-used.py
Created August 8, 2011 11:34
Least recently used matrix
#!/usr/bin/env python
import string
import sys
class LeastRecentlyUsedMatrix(object):
"""
Output matrix in table format
Return least recently used references
"""
MAX_MATRIX_SIZE = 70
@simonhayward
simonhayward / gunicorn_settings.py
Created August 8, 2011 08:52
Gunicorn settings file
import multiprocessing
# The socket to bind.
bind = "127.0.0.1:8080"
# The maximum number of pending connections.
backlog = 2024
# The number of worker process for handling requests
workers = multiprocessing.cpu_count() * 2 + 1
# The type of workers to use. (sync|eventlet|gevent|tornado)
worker_class = 'gevent'