How to Create a Date Time Snippet in Sublime Text 2 (Dynamic Signature with Time Stamp)

You’ll have to create a new plugin. From the menu bar select

Tools > New Plugin

Copy the Python script from the signature.py file. Remember to replace your email address (it’s example.com).
Save the file, signature.py, is fine. Next open up Preferences > Key Bindings – Default and add a new entry.

ctl+alt+s will add the snippet to the first line of your file.

How to Copy and Paste to/from the Global Register with Tmux on Mac OS X

Using the system clipboard with tmux on OS X is broken. I really like tmux but having copy and paste is kind of important for me. Here is my attempt to get it back with a simple bash script until I find something better. The approach is to take a named pipe and feed it the contents of “tmux showb”. A bash script will manage the pipe and because this script is initialized from a normal session it will write to the system clipboard just fine.

In my .bash_profile…

pipe4tmux=/tmp/pipe4tmux
alias tcp="tmux showb > $pipe4tmux"
if [[ ! -p $pipe4tmux ]]; then
~/pipe4tmux.sh &
fi

And in pipe4tmux.sh…

#!/bin/bash
pipe4tmux=/tmp/pipe4tmux
echo "Starting named pipe $pipe4tmux"
trap "rm -f $pipe4tmux" EXIT

if [[ ! -p $pipe4tmux ]]; then
  mkfifo $pipe4tmux
fi

while true
do
  pbcopy < $pipe4tmux
done

echo "Quitting pipe4tmux $pip4tmux"

Installing MatPlotLib on OS X for Python Version 2.6.1 with PIP and VirtualEnv

If you thought you had installed matplotlib only to find this

File "/Library/Python/2.6/site-packages/matplotlib-0.91.1-py2.6-macosx-10.6-universal.egg/matplotlib/numerix/__init__.py", line 166, in
__import__('ma', g, l)
File "/Library/Python/2.6/site-packages/matplotlib-0.91.1-py2.6-macosx-10.6-universal.egg/matplotlib/numerix/ma/__init__.py", line 16, in
from numpy.core.ma import *
ImportError: No module named ma

It is because the package being installed is version 0.91 and you need at least version 1.0 .

If it’s already installed pass pip the upgrade flag and specify the package location with the “-f” flag

pip install --upgrade -f http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0/matplotlib-1.0.0.tar.gz matplotlib

If not installed

pip install -f http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0/matplotlib-1.0.0.tar.gz matplotlib

Resources:

http://stackoverflow.com/questions/3555551/why-does-pip-install-matplotlib-version-0-91-1-when-pypi-shows-version-1-0-0