Skip to content

Instantly share code, notes, and snippets.

esc /
Last active Oct 8, 2018
Anconda activation and deactivation functions for ZSH
# Functions to activate/deactivate Continuum Analytics Anaconda Python distribution
# by manipulating the $PATH.
export ANACONDA_PATH="$HOME/anaconda/bin"
function have_anaconda(){
[[ -n $path[(r)$ANACONDA_PATH] ]]
function anaconda_on(){
if have_anaconda ; then
adamchainz /
Created Mar 25, 2015
Ansible Jinja2 filters for deleting anonymous ec2 instances
import datetime as dt
import time
import unittest
def aws_age_seconds(ec2_launch_time):
Parse the ec2 launch time string and return how old it is in seconds.
# Strip trailing subsecond part