- Software update
- Setup XCode
- Install Oh-my-ZSH
curl -L http://install.ohmyz.sh | sh
- Generate SSH keys
- Install Dotfiles
| from django.http import HttpResponse, HttpResponseForbidden | |
| def _auth_request(realm): | |
| response = HttpResponse() | |
| response.status_code = 401 | |
| response['WWW-Authenticate'] = 'Basic realm="%s"' % realm | |
| return response | |
| def http_basic_auth(username=None, password=None, realm='Authorization required'): |
| import json | |
| import urllib2 | |
| def get_vimeo_thumbnail(vimeo_video_id, size='large'): | |
| """Fetches a thumbnail URL for a given video (and size) from Vimeo metadata API""" | |
| assert size in ['small', 'medium', 'large'], 'You must specify a valid size! small/medium/large' | |
| req = urllib2.urlopen('http://vimeo.com/api/v2/video/%s.json' % vimeo_video_id) |
| import yaml | |
| DEFAULT_IGNORE = [ | |
| '__unicode__', '__module__', '_meta', 'MultipleObjectsReturned', '_base_manager', | |
| 'objects', 'DoesNotExist', '__doc__', '_default_manager', '_curried', | |
| ] | |
| def analyze_model(model, ignore=[], default_ignore=True): | |
| """Analyze a Django Model to return a list of methods along with | |
| the methods docstring""" |
| """Utility to clear our unused Django CMS placeholder data from database""" | |
| # Nick Snell <n@nicksnell.com> | |
| # WARNING; IS A DISTRUCTIVE OPERATION (Obviously.) | |
| from django.template import TemplateDoesNotExist | |
| from cms.models.pagemodel import Page | |
| from cms.utils.plugins import get_placeholders |
| from PIL import Image, ImageOps | |
| import requests | |
| class Tiler(object): | |
| def __init__(self, images, rows=4, tile_size=(135, 135)): | |
| self.images = images | |
| self.rows = rows | |
| self.tile_size = tile_size |
| #!/bin/sh | |
| PREFIX=$HOME/webapps/mongo_db | |
| $PREFIX/mongodb-linux-x86_64-2.6.3/bin/mongod --auth --dbpath $PREFIX/data/ --port <some port> --fork --logpath=$HOME/logs/user/mongod.log |
| #!/bin/sh | |
| PREFIX=$HOME/webapps/mongo_db | |
| kill -2 `cat $PREFIX/data/mongod.lock` |
| #!/bin/bash | |
| $HOME/webapps/mongo_db/bin/stop | |
| sleep 4 | |
| $HOME/webapps/mongo_db/bin/start |
curl -L http://install.ohmyz.sh | sh
| sudo /usr/libexec/PlistBuddy -c "Add :ProgramArguments: string --no-namechange" /System/Library/LaunchDaemons/com.apple.discoveryd.plist |