Skip to content

Instantly share code, notes, and snippets.

View ntang's full-sized avatar

Nicholas Tang ntang

  • MongoDB, Inc.
  • New York
View GitHub Profile
#
# shell function to print graphite graphs as sparklines in the terminal
# needs https://github.com/holman/spark
# from: https://twitter.com/mrtazz/status/226297265512402946
#
function graphline() {
GRAPHITEHOST="graphite.example.com"
if [ ! -n "$1" ]; then echo "Usage: $FUNCNAME METRIC [minutes]"; return 1; fi
if [ ! -n "$2" ]; then MINUTES=10 ; else MINUTES=$2; fi
curl -s "${GRAPHITEHOST}/render?from=-${MINUTES}minutes&target=${1}&format=raw" | sed s/,None//g | cut -d"|" -f 2 | spark ;
@ntang
ntang / fap.py
Created February 11, 2013 17:32 — forked from ntang-livestream/fap.py
#!/usr/bin/env python
#
# Fairly Automated Paster
#
# Automatically creates gists ('gisting') by pasting text.
# FAP lets you gist really quickly and easily, all over the place.
# This first version only allows you to create anonymous gists.
#
# Nicholas Tang (nicholastang@gmail.com)