Skip to content

Instantly share code, notes, and snippets.

View willthames's full-sized avatar

Will Thames willthames

View GitHub Profile
@willthames
willthames / output
Created November 1, 2013 03:58
Demonstration of long running script
[will@tangerine nohup-test]$ ansible-playbook playbook.yml --limit 127.0.0.1
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [127.0.0.1]
TASK: [run long running script] ***********************************************
^CTraceback (most recent call last):
File "/home/will/src/ansible/bin/ansible-playbook", line 268, in <module>
hello {{ who }}
@willthames
willthames / training.py
Created April 25, 2012 08:32
Graph three pre-marathon run volumes
import numpy as np
from pandas import *
import matplotlib.pyplot as plt
from pylab import figure, show
from datetime import timedelta
df = read_csv('training.csv', sep = ' , ',
names=[ 'date', 'activity', 'distance', 'duration'])
df['date'] = df['date'].apply(lambda x: datetime.strptime(x, '%d/%m/%Y'))
@willthames
willthames / effortvalue.py
Created April 2, 2012 10:25
Use matplotlib, pandas, numpy etc to plot an effort vs value CSV file
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from pandas import *
from pylab import figure, show
def trimnum(n):
if abs(n - int(n)) > 0.05:
return "%.1f" % n