Skip to content

Instantly share code, notes, and snippets.

Allan Beaufour beaufour

Block or report user

Report or block beaufour

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@beaufour
beaufour / requirements.txt
Last active Sep 11, 2019
Save Speedtest.net data to InfluxDB
View requirements.txt
delegator.py==0.1.1
requests==2.22.0
@beaufour
beaufour / keybase.md
Last active Feb 25, 2017
Keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am beaufour on github.
  • I am beaufour (https://keybase.io/beaufour) on keybase.
  • I have a public key whose fingerprint is 96CC B7F1 EDDF 85F1 6263 6DF9 B449 C455 BB2F 12A7

To claim this, I am signing this object:

View hubot-upstart.conf
# hubot
#
description "Hubot chat bot"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
setuid ubuntu
setgid ubuntu
View hubot-upstart.conf
# hubot
#
description "Hubot chat bot"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
setuid ubuntu
setgid ubuntu
View hubot_run.sh
#!/bin/bash
# Core
export HUBOT_HIPCHAT_JID="XXXXX"
export HUBOT_HIPCHAT_PASSWORD="YYYYY"
export HUBOT_AUTH_ADMIN=ZZZZZ
export HUBOT_DIR=/home/ubuntu/ponce
# Plugins
export HUBOT_DARK_SKY_API_KEY="XXXXXX"
@beaufour
beaufour / pre-commit-runner.bash
Created Apr 2, 2013
A git commit hook runner, for running multiple commit scripts
View pre-commit-runner.bash
#!/bin/bash
#
# Collection of pre-commit hooks
#
set -e
# Get directory of script file
ME=$0
if [ -h ${ME} ]; then
@beaufour
beaufour / todo-check.py
Created Apr 2, 2013
Git commit hook to check for lines with "TODO" in them
View todo-check.py
#!/usr/bin/python
import logging
import re
import sys
import envoy
def _exec_git(cmd, args=''):
cmd = 'git {0} --color=never {1}'.format(cmd, args)
View .gitconfig
[user]
name = Allan Beaufour
email = ...
[color]
ui = auto
[pack]
threads = 0
@beaufour
beaufour / gzipinputstream.py
Created Dec 4, 2012
Python: Streaming Gzip reader
View gzipinputstream.py
import zlib
import string
BLOCK_SIZE = 16384
"""Read block size"""
WINDOW_BUFFER_SIZE = 16 + zlib.MAX_WBITS
"""zlib window buffer size, set to gzip's format"""
@beaufour
beaufour / language.py
Created Nov 30, 2012
Django Middleware to choose language based on subdomain
View language.py
import logging
from django.utils import translation
class SubdomainLanguageMiddleware(object):
"""
Set the language for the site based on the subdomain the request
is being served on. For example, serving on 'fr.domain.com' would
make the language French (fr).
You can’t perform that action at this time.