Install virtualenv/virtualwrapper:
sudo easy_install pip
sudo pip install virtualenvwrapper
Create a venv for libs you want to reuse in other venvs:
| # -*- coding: utf-8 -*- | |
| """ | |
| Search features for : | |
| * :mod:`elasticsearch.elasticsearch` | |
| * :mod:`haystack:haystack` | |
| * :mod:`elasticstack:elasticstack` | |
| :creationdate: 05/11/15 15:05 | |
| :moduleauthor: François GUÉRIN <[email protected]> |
| # Sharing Django Users and Sessions Across Projects | |
| By Dustin Farris on 22 Feb 2012 | |
| This document describes how to share users created using Django's auth system with other | |
| Django projects. It is not a hack; it simply makes use of the database router and | |
| middleware system that Django comes with out of the box. | |
| ## Introduction |
| /** | |
| * Fancy ID generator that creates 20-character string identifiers with the following properties: | |
| * | |
| * 1. They're based on timestamp so that they sort *after* any existing ids. | |
| * 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
| * 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
| * 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
| * latter ones will sort after the former ones. We do this by using the previous random bits | |
| * but "incrementing" them by 1 (only in the case of a timestamp collision). | |
| */ |
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
| # Be sure to save your config files. Optional but I do: | |
| sudo cp /etc/postgresql/9.3/main/postgresql.conf ~ | |
| sudo cp /etc/postgresql/9.3/main/pg_hba.conf ~ | |
| # Package repo (for apt-get) | |
| wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
| sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list' | |
| # Also probably optional but I like to update sources and upgrade | |
| sudo apt-get update |
| From: Chris DeSalvo <[email protected]> | |
| Subject: Why we can't process Emoji anymore | |
| Date: Thu, 12 Jan 2012 18:49:20 -0800 | |
| Message-Id: <[email protected]> | |
| --Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B | |
| Content-Transfer-Encoding: quoted-printable | |
| Content-Type: text/plain; | |
| charset=utf-8 |
| """ | |
| A redis autocomplete example for multi-word phrases. | |
| Based on: | |
| Ruby original: http://gist.github.com/574044 | |
| Python original: https://gist.github.com/577852 | |
| See options below for usage | |
| Requires http://github.com/andymccurdy/redis-py/ |