start new:
tmux
start new with session name:
tmux new -s myname
nosetests --with-profile --profile-stats-file=nose.prof | |
python -c "import hotshot.stats ; stats = hotshot.stats.load('nose.prof') ; stats.sort_stats('time', 'calls') ; stats.print_stats(20)" |
# | |
# String.hashCode in Python | |
# | |
def java_string_hashcode(s): | |
h=0 | |
for c in s: | |
h = (31 * h + ord(c)) & 0xFFFFFFFF | |
return (h + 0x80000000) & 0xFFFFFFFF - 0x80000000 |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' | |
green='\033[0;32m' |
# Xcode | |
.DS_Store | |
build/ | |
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 | |
!default.mode1v3 | |
*.mode2v3 | |
!default.mode2v3 | |
*.perspectivev3 |
class Something(Base): | |
__tablename__ = 'yaddayadda' | |
id = Column(Integer, primary_key=True) | |
data = Column(MutableList.as_mutable(ARRAY(String(100)))) |
import cStringIO | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
def s3upload(filename, extension, file): | |
conn = S3Connection('AWS_ACCESS_KEY', 'AWS_SECRET_KEY') | |
k = Key(conn.get_bucket('<bucket name>')) | |
k.key = filename | |
k.set_metadata("Content-Type", file.mimetype) |
brew install sox | |
cat /dev/urandom | sox -traw -r44100 -b16 -e unsigned-integer - -tcoreaudio |
First execute the following commands to install openssl on OSX using Homebrew:
brew update
brew install openssl
brew link --force openssl
openssl version -a
If the new version has not been applied successfully, create a symlink to solve the problem. To do that, we need to figure out the location of openssl using