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
""" | |
Parse the pygotham json schedule and make ical output | |
for use w/ google calendar, etc. | |
NOTE if you are going to serve the result, apparently google cal won't parse | |
it unless the header Content-Type: text/calendar is set! | |
Really useful for testing output: http://icalvalid.cloudapp.net | |
and http://severinghaus.org/projects/icv/ | |
""" |
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
if geom.srs is None: | |
geom.srid = 4326 | |
geom = geom.transform(4326, True) | |
if hasattr(geom, 'geos'): | |
geom = geom.geos |
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
from ebpub.utils.geodjango import ensure_valid | |
from ebpub.utils.geodjango import flatten_geomcollection | |
def convert1(geom, srid=4326): | |
# Karen's version | |
geom = geom.transform(srid, True) | |
if hasattr(geom, 'geos'): | |
geom = geom.geos | |
return geom |
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
""" | |
This takes the sqlite 'notes' database from an iphone and dumps it to | |
flat text files in the current directory, preserving modification | |
times. | |
Uses 'lynx' (separate program) to dump html to plain text. | |
""" | |
import sqlite3 | |
import datetime |
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
diff --git a/ebpub/ebpub/db/migrations/0005_newsitem_location_trigger.py b/ebpub/ebpub/db/migrations/0005_newsitem_location_trigger.py | |
index 53fd108..721a133 100644 | |
--- a/ebpub/ebpub/db/migrations/0005_newsitem_location_trigger.py | |
+++ b/ebpub/ebpub/db/migrations/0005_newsitem_location_trigger.py | |
@@ -33,38 +33,16 @@ class Migration(DataMigration): | |
DELETE FROM db_newsitemlocation WHERE news_item_id = OLD.id; -- | |
END IF; -- | |
IF (NEW.location IS NOT NULL) THEN | |
- IF (GeometryType(NEW.location) = 'GEOMETRYCOLLECTION') THEN | |
- FOR i IN 1..ST_NumGeometries(NEW.location) LOOP |
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
def oauth_authorize_without_confirmation(request, request_token, callback_url, params): | |
""" | |
This version uses some hackery to pretend the user has confirmed. | |
""" | |
params = request.GET.copy() | |
params['authorize_access'] = True | |
# request.POST claims to be immutable, but of course there's a way. | |
# Presumably I could just look up the HTTPRequest constructor... | |
request._set_post(params) |
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
#!/usr/bin/env python | |
""" | |
Rip a CD and encode the results to ogg. | |
Try to tag the ogg files, too. | |
And flac. | |
""" | |
# Stdlib imports | |
import glob |
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
diff --git a/doc-src/olwidget.js.rst b/doc-src/olwidget.js.rst | |
index 4a5ff97..dd8504b 100644 | |
--- a/doc-src/olwidget.js.rst | |
+++ b/doc-src/olwidget.js.rst | |
@@ -306,7 +306,30 @@ General map display | |
``'ve.shaded'``, ``'ve.aerial'``, ``'ve.hybrid'``, ``'wms.map'``, | |
``'wms.nasa'``, ``'yahoo.map'``, and ``'cloudmade.<num>'`` (where ``<num>`` | |
is the number for a cloudmade style). A blank map can be obtained using | |
- ``'wms.blank'``. Additional providers or options can be manually added | |
+ ``'wms.blank'``. |
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
MULTIPOLYGON (((-71.0577100000000002 42.3567770000000010, -71.0578089999999918 42.3560179999999988, -71.0578469999999953 42.3558499999999967, -71.0578699999999941 42.3557890000000015, -71.0584619999999916 42.3560919999999967, -71.0585849999999937 42.3559809999999999, -71.0589190000000031 42.3557399999999973, -71.0590569999999957 42.3559270000000012, -71.0594200000000029 42.3563989999999961, -71.0591620000000006 42.3566259999999986, -71.0589169999999939 42.3568429999999978, -71.0587369999999936 42.3569880000000012, -71.0582349999999963 42.3568319999999972, -71.0579929999999962 42.3567889999999991, -71.0577100000000002 42.3567770000000010)), ((-71.0510450000000020 42.3633329999999972, -71.0510000000000019 42.3625839999999982, -71.0516030000000001 42.3630409999999955, -71.0516470000000027 42.3631099999999989, -71.0517779999999988 42.3629419999999968, -71.0518979999999942 42.3628050000000016, -71.0510629999999992 42.3622480000000010, -71.0511010000000027 42.3621739999999960, -71.0512009999999918 42.36206599999999 |
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
<div id="{{ id }}"></div> | |
{{ layer_html|join:"" }} | |
<script type="text/javascript"> | |
var olwidget_map_{{id}} = new olwidget.Map("{{ id }}", [ | |
{{ layer_js|join:"," }} | |
], | |
{{ map_opts|safe }} | |
); | |
var extra_layers = {{ extra_base_layers|default:"[]"|safe }}; | |
for (var i=0, len=extra_layers.length; i < len; ++i) { |