This file contains hidden or 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/bash | |
| # This hook is run after every virtualenv is activated. | |
| export OLD_GEM_HOME=$GEM_HOME | |
| export GEM_HOME=$VIRTUAL_ENV/gems/ | |
| export GEM_PATH= | |
| export PATH=$VIRTUAL_ENV/gems/bin:$PATH |
This file contains hidden or 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
| >>> import simplegeo | |
| >>> from itertools import ifilter | |
| >>> client = simplegeo.context.Client('your-key','your-secret') | |
| >>> location = client.get_context_by_address("41 Decatur St, San Francisco, CA") | |
| # Find the bounding box of your current city | |
| >>> sf = next(ifilter(lambda feature: feature['classifiers'][0]['category'] == 'Administrative', location['features']), None) | |
| >>> hoods = client.get_features_from_bbox(sf['bounds'], features__category='Neighborhood') |
This file contains hidden or 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
| /** | |
| * Note: the following function should already exist in your application delegate file. | |
| * Replace it with the following implementation. | |
| * | |
| * Thanks to @purplecabbage for implementation. | |
| * Thanks to Ruddiger for the iFrame patch. | |
| */ | |
| // ... |
This file contains hidden or 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
| """ | |
| jQuery templates use constructs like: | |
| {{if condition}} print something{{/if}} | |
| This, of course, completely screws up Django templates, | |
| because Django thinks {{ and }} mean something. | |
| Wrap {% verbatim %} and {% endverbatim %} around those | |
| blocks of jQuery templates and this will try its best |
NewerOlder