This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://littletutorials.com/2008/06/23/inheritance-not-for-code-reuse/ | |
def mixin(mixin_cls): | |
def mixin_decorator(cls): | |
if not hasattr(cls, '__mixed__'): | |
cls.__mixed__ = [] | |
for name, val in mixin_cls.__dict__.items(): | |
if not name.startswith('__') and not name.endswith('__'): | |
if not hasattr(cls, name): | |
setattr(cls, name, val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageChops | |
def trim(im, border): | |
bg = Image.new(im.mode, im.size, border) | |
diff = ImageChops.difference(im, bg) | |
bbox = diff.getbbox() | |
if bbox: | |
return im.crop(bbox) | |
def create_thumbnail(path, size): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
if !1 | finish | endif | |
if has('vim_starting') | |
set nocompatible " Be iMproved | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
endif | |
let neobundle_readme=expand($HOME.'/.vim/bundle/neobundle.vim/README.md') | |
if !filereadable(neobundle_readme) | |
silent !curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.vagrant/ | |
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@patch('quote_options.models.LiabilityLimit.objects.filter') | |
@patch('quote.models.Q') | |
def should_filter_with_q_object_in_get_liability_limits(self, q_object, limit_filter): | |
manager_instance = Mock(spec=quote_models.LiabilityManager()) | |
policy = mock.Mock() | |
q_instance = mock.Mock() | |
q_or_method = mock.Mock() | |
q_or_method.return_value = q_instance | |
q_instance.__or__ = q_or_method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://raw.github.com/toranb/osx-workstation/master/installer | bash | |
git clone https://github.com/JarrodCTaylor/imt_dotfiles.git | |
cd ~/imt_dotfiles/Mac | |
bash symlink.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# vim: set foldmarker=<<,>> foldlevel=1 foldmethod=marker: | |
#=================================================================================== | |
# .__ | |
# ________ _____| |_________ ____ | |
# \___ / / ___/ | \_ __ \_/ ___\ | |
# / / \___ \| Y \ | \/\ \___ | |
# /_____ \/____ >___| /__| \___ > | |
# \/ \/ \/ \/ | |
#=================================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Loading Aliases" | |
alias ls='ls -FHG' | |
alias ll='ls -lh' | |
alias la='ls -la' | |
alias l='ls' | |
alias lls='ll -Sr' | |
alias less='less -imJMW' | |
alias update='brew update && brew upgrade' | |
alias upgrade='brew upgrade' | |
alias clean='brew doctor' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Loading Emacs Bindings" | |
bindkey '^b' backward-word | |
bindkey '^f' forward-word | |
bindkey '^R' history-incremental-search-backward | |
bindkey '^R' history-incremental-pattern-search-backward | |
bindkey '^?' backward-delete-char | |
bindkey '^H' backward-delete-char |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Loading Aliases" | |
alias ls='ls -FHG' | |
alias ll='ls -lh' | |
alias la='ls -la' | |
alias l='ls' | |
alias lls='ll -Sr' | |
alias less='less -imJMW' | |
alias update='brew update && brew upgrade' | |
alias upgrade='brew upgrade' | |
alias clean='brew doctor' |
NewerOlder