Skip to content

Instantly share code, notes, and snippets.

View nZac's full-sized avatar

Nick Zaccardi nZac

View GitHub Profile
# This is my personal zsh-theme file it requires oh-my-zsh and the
# wonderful virtualenv-prompt https://github.com/tonyseek/oh-my-zsh-virtualenv-prompt
# plugin
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
CURRENT_TIME_=" %T%{$reset_color%}"
ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX="$FG[237]-----$FG[075] ( venv: "
ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="$FG[075] ) $FG[237]-----"
@nZac
nZac / max_int_in_dict.py
Created November 2, 2013 19:28
Find the largest int in a dictionary
print stats
# {'a': 3, 'c': 1, 'b': 8}
max(stats.iterkeys(), key=lambda key: stats[key])
# 'b'