Linux 2.6.32-431.23.3.el6.x86_64
## Using conda 4.3.33
## remove unstable conda env
conda env remove --name rvlabpy2| # Edit the clipboard in your $EDITOR | |
| # Add this to your `.bashrc` file | |
| function pbedit () { | |
| local tmpfile=`mktemp` | |
| pbpaste > $tmpfile | |
| $EDITOR $tmpfile | |
| pbcopy < $tmpfile | |
| rm -f $tmpmfile | |
| } | |
| export -f pbedit |
| #!/bin/sh | |
| # http://stackoverflow.com/questions/4528869/how-do-you-attach-a-new-pull-request-to-an-existing-issue-on-github | |
| if [ $# -lt 4 ]; then | |
| echo "Usage: ${0##*/} [issue_num] [username/repo] [base_branch] [head_username:branch]" >&2 | |
| exit 1 | |
| fi | |
| user="$(pass github.com|awk '/^username:/{print $2}')" | |
| issue=$1 |
| import json, datetime | |
| class RoundTripEncoder(json.JSONEncoder): | |
| DATE_FORMAT = "%Y-%m-%d" | |
| TIME_FORMAT = "%H:%M:%S" | |
| def default(self, obj): | |
| if isinstance(obj, datetime.datetime): | |
| return { | |
| "_type": "datetime", | |
| "value": obj.strftime("%s %s" % ( |
I've been using the Anaconda python package from continuum.io recently and found it to be a good way to get all the complex compiled libs you need for a scientific python environment. Even better, their conda tool lets you create environments much like virtualenv, but without having to re-compile stuff like numpy, which gets old very very quickly with virtualenv and can be a nightmare to get correctly set up on OSX.
The only thing missing was an easy way to switch environments - their docs suggest running python executables from the install folder, which I find a bit of a pain. Coincidentally I came across this article - Virtualenv's bin/activate is Doing It Wrong - which desribes a simple way to launch a sub-shell with certain environment variables set. Now simple was the key word for me since my bash-fu isn't very strong, but I managed to come up with the script below. Put this in a text file called conda-work
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
| #!/bin/bash | |
| if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
| appify v3.0.1 for Mac OS X - http://mths.be/appify | |
| Creates the simplest possible Mac app from a shell script. | |
| Appify takes a shell script as its first argument: | |
| `basename "$0"` my-script.sh |