Skip to content

Instantly share code, notes, and snippets.

@adamchainz
adamchainz / my_filters.py
Created Mar 25, 2015
Ansible Jinja2 filters for deleting anonymous ec2 instances
View my_filters.py
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
@esc
esc / anaconda.sh
Last active Oct 8, 2018
Anconda activation and deactivation functions for ZSH
View anaconda.sh
# 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