Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
class AbstractMixin(object): | |
_classcache = {} | |
@classmethod | |
def contribute(cls): | |
return {} | |
@classmethod | |
def construct(cls, *args, **kwargs): | |
attrs = cls.contribute(*args, **kwargs) |
class LimitedAdminInlineMixin(object): | |
""" | |
InlineAdmin mixin limiting the selection of related items according to | |
criteria which can depend on the current parent object being edited. | |
A typical use case would be selecting a subset of related items from | |
other inlines, ie. images, to have some relation to other inlines. | |
Use as follows:: |
if not hasattr(ForeignModel, "tags"): | |
t = TaggableManager() | |
t.contribute_to_class(ForeignModel, "tags") |
#!/bin/bash | |
# | |
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box | |
# http://wildfish.com | |
# add the ubuntu gis ppa | |
sudo apt-get -y install python-software-properties | |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get update |
import logging | |
logger = logging.getLogger('commerce') | |
class LimitedAdminInlineMixin(object): | |
""" | |
InlineAdmin mixin limiting the selection of related items according to | |
criteria which can depend on the current parent object being edited. | |
A typical use case would be selecting a subset of related items from | |
other inlines, ie. images, to have some relation to other inlines. |
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core? | |
L.TileLayer.Common = L.TileLayer.extend({ | |
initialize: function (options) { | |
L.TileLayer.prototype.initialize.call(this, this.url, options); | |
} | |
}); | |
(function () { | |
from django.template.loader_tags import ExtendsNode | |
def get_extends_parent(self, context): | |
""" | |
Patched onto Django's ``ExtendsNode.get_parent`` which is | |
responsible for loading the template to extend from with | |
the ``extends`` template tag. | |
This patch allows the template foo/bar.html to extend | |
foo/bar.html, given that there is another version of it that |
""" | |
This fabric script automates the creation of a virtual environment and a Django | |
project. The result will be virtual environtment with the name of the project. | |
The folder namer where the project code will be placed is specified in | |
SOURCE_DIRECTORY_NAME, a static root folder will be created and settings.py | |
will be updated. | |
""" | |
try: | |
from fabric.api import env, run, local | |
from fabric.context_managers import lcd, prefix |
#!/usr/bin/env python | |
import urllib | |
import httplib2 | |
cert_file = 'my.pem' | |
http = httplib2.Http(disable_ssl_certificate_validation=True) | |
http.add_certificate('', cert_file, domain='') |