Install Homebrew
Install a few things with homebrew:
Notice that some packages give you information at the end, read it carefully. To recall that info use brew info like this: $ brew info postgresql
$ brew install python --universal
| # All bindings refer to the current screen. | |
| config defaultToCurrentScreen true | |
| # Nudge/resize commands refer to % of screen sice. | |
| config nudgePercentOf screenSize | |
| config resizePercentOf screenSize | |
| # my old divvy bindings (might wanna replace these some day?) | |
| # corners: q/e/z/c for nw/ne/sw/se, quarter screen | |
| alias resize-quarter resize:screenSizeX/2;screenSizeY/2 |
| Original Torrent was missing a single talk; revised all the things. | |
| Supplement Torrent from original Torrent File: http://goo.gl/Rckdg | |
| Magnet: magnet:?xt=urn:btih:d4ecb90b455d557000c86953b9352094c994a864&dn=DjangoCon%20US%202012&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80 | |
| Updated Torrent (Full Conference): http://goo.gl/RK0yX | |
| Magnet Link: magnet:?xt=urn:btih:be8aa997451566a9698eb4b6c54c45794c9a8419&dn=DjangoCon%20US%202012-Supplement&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80 |
| from django.template.defaultfilters import slugify | |
| from django.contrib.sites.models import Site | |
| from django.core.files import File | |
| from taggit.models import Tag | |
| from .models import Photo | |
| import factory | |
| import os | |
| TEST_MEDIA_PATH = os.path.join(os.path.dirname(__file__), 'tests', 'test_media') | |
| TEST_PHOTO_PATH = os.path.join(TEST_MEDIA_PATH, 'test_photo.png') |
| # example from: http://stackoverflow.com/questions/68630/are-tuples-more-efficient-than-lists-in-python | |
| $ python -m timeit "x=(1,2,3,4,5,6,7,8)" | |
| 10000000 loops, best of 3: 0.0571 usec per loop | |
| $ python -m timeit "x=[1,2,3,4,5,6,7,8]" | |
| 1000000 loops, best of 3: 0.254 usec per loop | |
| $ python -m timeit -s "x=(1,2,3,4,5,6,7,8)" "y=x[3]" | |
| 10000000 loops, best of 3: 0.0758 usec per loop |
| from django.contrib.admin import FieldListFilter | |
| from django.utils.translation import ugettext as _ | |
| class ActiveValueFilter(FieldListFilter): | |
| """list_filter which displays only the values for a field which are in use | |
| This is handy when a large range has been filtered in some way which means | |
| most of the potential values aren't currently in use. This requires a | |
| queryset field or annotation named "item_count" to be present so it can |
| $ ./pip.sh outdated | |
| Fabric (1.4.3 != 1.5.1) | |
| gunicorn (0.17.0 != 0.17.2) | |
| $ ./pip.sh install -U gunicorn | |
| Downloading/unpacking gunicorn==0.17.2 | |
| Using download cache from /Users/jefftriplett/.pip/download_cache/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fg%2Fgunicorn%2Fgunicorn-0.17.2.tar.gz | |
| Running setup.py egg_info for package gunicorn | |
| Installing collected packages: gunicorn |
Install Homebrew
Install a few things with homebrew:
Notice that some packages give you information at the end, read it carefully. To recall that info use brew info like this: $ brew info postgresql
$ brew install python --universal
| import os | |
| import barrel | |
| REALM = "PRIVATE" | |
| USERS = [('jacob', 'hunter2')] | |
| os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") | |
| from django.core.wsgi import get_wsgi_application | |
| application = barrel.cooper.basicauth(users=USERS, realm=REALM)(get_wsgi_application()) |
| { | |
| "auto_complete": false, | |
| "auto_complete_commit_on_tab": false, | |
| "auto_complete_delay": 50, | |
| "auto_complete_selector": "source - comment", | |
| "auto_complete_size_limit": 4194304, | |
| "auto_complete_triggers": | |
| [ | |
| { | |
| "characters": "<", |
| ''' | |
| Warning! Your mileage may vary | |
| Based on: | |
| - Read this for EC2 setup info and the approach - http://www.dikant.de/2010/10/08/setting-up-a-vpn-server-on-amazon-ec2/ | |
| - https://gist.github.com/1130401 | |
| - EC2 fabric bits via - https://github.com/slacy/fabric-ec2 | |
| ''' |