Skip to content

Instantly share code, notes, and snippets.

View kfr2's full-sized avatar
🌮
Hello!

Kevin Richardson kfr2

🌮
Hello!
View GitHub Profile
@kfr2
kfr2 / .Xresources
Created August 20, 2017 19:04
Monokai Dark Xresources
! exported from https://terminal.sexy
! special
*.foreground: #f8f8f2
*.background: #272822
*.cursorColor: #f8f8f2
! black
*.color0: #272822
*.color8: #75715e
### Keybase proof
I hereby claim:
* I am kfr2 on github.
* I am kfr2 (https://keybase.io/kfr2) on keybase.
* I have a public key ASBEf6RHo0tfbAMdqGucxD1kjaoFAXkmHB6jMsxUBgllgwo
To claim this, I am signing this object:
@kfr2
kfr2 / notifier.py
Last active March 14, 2016 13:27
send Codeship build notifications to OSX User Notifications
"""
Codeship build notifications via OSX User Notifications.
Requirements:
* python-requests
* terminal-notifier
Environment settings:
* CODESHIP_API_KEY -- get it from https://codeship.com/user/edit
* CODESHIP_REPO_NAME -- the full name of the repository to watch
@kfr2
kfr2 / policy.json
Created July 6, 2014 22:45
S3 bucket access IAM policy
{
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Action": "s3:*",
"Effect": "Allow",
@kfr2
kfr2 / victory.coffee
Created June 23, 2014 22:26
Have Hubot celebrate a successful build with a dance!
# Description:
# Celebrate a successful build with a victory dance!
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_DISABLE_VICTORY - if set, the victory dance shall not occur
#
# Commands:
@kfr2
kfr2 / gist.py
Last active December 17, 2015 08:29
A Pelican plugin to convert "[[ gist username:ID ]]" in an article into its embedded <script> equivalent.
import re
from pelican import signals
def gist(content):
"""Converts [[ gist username:ID ]] in an article into its embedded <script> equivalent."""
pattern = r'\[\[ gist (\w+):(\d+) \]\]'
replacement = r'<script src="https://gist.github.com/\1/\2.js"></script>'
content._content = re.sub(pattern, replacement, unicode(content._content))
@kfr2
kfr2 / README.rst
Created February 12, 2013 02:15 — forked from rduplain/README.rst
A demonstration of how to test Flask applications using fixtures with Flask-SQLAlchemy and Flask-Testing.

Demonstrate use of fixture with Flask-SQLAlchemy and Flask-Testing. February 13, 2011 Ron DuPlain <ron.duplain@gmail.com>

Post any feedback to: flask@librelist.org

Get this gist:

git clone git://gist.github.com/824472.git Flask-SQLAlchemy-Fixture
cd Flask-SQLAlchemy-Fixture
@kfr2
kfr2 / csv2xls.py
Last active December 10, 2015 00:39
Converts the specified CSV file to XLS using xlwt and outputs to stdout.
"""
Converts the specified CSV file to XLS using xlwt.
Copyright 2012 Kevin Richardson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
@kfr2
kfr2 / union_csv.py
Last active December 9, 2015 22:18
Output the intersection of elements contained within the first column of the CSV files passed in as command line arguments.
"""
Output the intersection of elements contained within the first column of the
passed-in CSV files.
Copyright 2012 Kevin Richardson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
# FROM: http://en.wikipedia.org/wiki/Base_36#Python_implementation
def base36encode(number):
"""Converts an integer into a base36 string."""
ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if not isinstance(number, (int, long)):
raise TypeError('This function must be called on an integer.')
base36 = ''