Skip to content

Instantly share code, notes, and snippets.

View jesseh's full-sized avatar

Jesse Heitler jesseh

View GitHub Profile
@jesseh
jesseh / Gmail_to_RTM.js
Last active June 16, 2017 16:07
Create Remember The Milk tasks from Gmail threads by simply adding a label. A Google App Script
/*
This script watches a gmail account for any thread labeled with 'rtm'. When such a thread is found it
sends a task-creation email to Remember the Milk that includes a link back to the original thread.
To follow the link back to the email you have to be logged in to the originating Gmail account (which
is only an issue if you have multiple gmail accounts). Otherwise Google claims the email cannot be
found.
To install it go into Google Drive and create a new "Script" (the link is a bit hidden in the create submenu).
Copy this code into the new project and set a time-based trigger.
@jesseh
jesseh / pareto.py
Created November 29, 2012 13:39
Pareto Chart with Matplotlib
import pandas as pd
import matplotlib.pyplot as plt
def combined_label(perc, tot):
"""
Format a label to include by Euros and %.
"""
return "{0:,.0f}k EUR, {1:.0f}%".format(perc * tot / 1000, perc * 100)
def cost_cum(data, focus, subject):
@jesseh
jesseh / README.md
Created November 29, 2012 13:07
Pair Contribution and Selection

This is a data set of the cost of repairing damage done to shipping containers. Each repair involves a type of damage done to a part of a container. And each repair has an associated cost. The question is how much does a set of damage-part pairs contribute to the total cost of repairs? And, if an intervention were made to address some types of damage and/or some part how much savings would result? This chart shows the damage types (left side) and the part types (right side). The height of each block indicates the blocks contribution to the total repair costs. The bands between the two sides show the cost contribution of each damage/part pair. Dark gray bands are selected for the total percentage number, while light gray bands are not. Putting your mouse over a block label will show what contributes to the repair costs associated with that block. You can change which damage/part pairs are selected by clicking on the blocks. Within each block. Only damage/part pairs where both the damage and part a

@jesseh
jesseh / README.md
Created November 22, 2012 11:21 — forked from mbostock/.block
Streamgraph

For continuous data such as time series, a streamgraph can be used in place of stacked bars. This example also demonstrates path transitions to interpolate between different layouts. Streamgraph algorithm, colors, and data generation inspired by Byron and Wattenberg.

@jesseh
jesseh / gist:970832
Created May 13, 2011 16:25
Generate release notes from Git with test expectations using fabric - see http://wp.me/p1ySiS-4
def _get_notes(prev_tag, next_tag):
with hide('stdout'):
commits = run("git log --graph --pretty=format:'%h - %s (%cr by %an)%d' "
+ "--abbrev-commit --date=relative"+ " %s..%s"
% (prev_tag, next_tag)).splitlines()
commits.pop() # prev_tag went out with the previous release notes.
commits.reverse() # order going down with time
commits = "\n".join(commits)
commits = re.sub(r"\\",r"__SUB__", commits)
commits = re.sub(r"/",r"\\", commits)