Skip to content

Instantly share code, notes, and snippets.

@feth
feth / myfirstinadequate3dbar.py
Created November 20, 2013 09:16
Oksélé. My first inadequate 3d bar plot with matplotlib
# encoding: utf-8
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import numpy as np
import codecs
import pylab
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
@feth
feth / source_tcsh.sh
Last active December 24, 2015 16:08
source tcsh environment variables
# bash script to be sourced
source_tcsh() {
tchsh_file=$1
TCSH_ENV=`tcsh -c "source ${tchsh_file} ; printenv"`
NEW_ENV=`echo -e "$TCSH_ENV" | sed -e 's/=/=\"/' -e 's/$/\"/' -e '/^PROFILEREAD=.*$/d'`
eval "$NEW_ENV"
}
@feth
feth / letsgetdirty.py
Created March 26, 2012 05:47
print invocation context
from inspect import currentframe, isfunction, ismethod, isclass, getframeinfo
def wannaknow(message):
#wander until correct frame
frame = currentframe()
interframe = frame.f_back
frame = interframe.f_back
if frame is None: