Skip to content

Instantly share code, notes, and snippets.

View rmorgans's full-sized avatar

Rick Morgans rmorgans

View GitHub Profile
@esc
esc / anaconda.sh
Last active October 8, 2018 21:06
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
adamchainz / my_filters.py
Created March 25, 2015 23:10
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