Skip to content

Instantly share code, notes, and snippets.

View eightysteele's full-sized avatar

Aaron Steele eightysteele

View GitHub Profile
// Setup app:
var mol = MOL(function(mol) {
bus = new mol.events.Bus();
api = new mol.ajax.Api(bus);
var config = {bus: bus, api: api, logging:true};
var app = new mol.app.Instance(config);
app.run();
return this;
});
class OccurrencePolygonSet(db.Model):
# Normal properties...
class Ecoregion(db.Model):
cluster = db.ReferenceProperty(OccurrencePolygonSet)
terms = db.StringListProperty()
# Other properties here...
# Find all ecoregions for a cluster where the ecoregion is introduced and g200Num is 2:
cluster = OccurrencePolygonSet.get(some_key)
{
"item":{
"source":"World Wildlife Fund (WWF)",
"type":"Ecoregion",
"name":"Admiralty Island lowland rain forests",
"description":"",
"storage":{
"location":"G:/MoL/....",
"format":"esri-shape"
},
var event = new MOL.env.events.LocationEvent({}, 'get-url');
MOL.app.getBus().addHandler(
"LocationEvent",
function(event){
if (event.getAction() == 'take-url') {
alert(event.getLocation().url);
}
}
);
@eightysteele
eightysteele / gist:1079737
Created July 13, 2011 04:52
Record example
class Record(model.Model):
collections = model.StringProperty('c', repeated=True)
@eightysteele
eightysteele / gist:1108715
Created July 27, 2011 05:00
VertNet bulkloader payload example
{
"publishers":[ // List of publishers
{
"key_urlsafe":"asdfLKJDldglkjdgD",
"collections":[ // List of publisher collections
{
"key_urlsafe":"asdfLKJDldglkjdgD",
"records":[ // List of collection records
{
"key_urlsafe":"agFfckELEglQdWJsaXNoZ",
@eightysteele
eightysteele / gist:1116099
Created July 30, 2011 22:43
MapReduce results over MasterSearchIndex: errortype,MSI.term,count
noparent,(tuberculosus),1
noparent,55,1
noparent,?,1
noparent,[abbotti],1
noparent,aaptus,1
noparent,aardvark,1
noparent,aba roundleaf bat,1
noparent,abae,1
noparent,abaxillare,1
noparent,abbotti,2
function(doc) {
emit(doc._id, {rev:doc._rev, coords:doc.coords, varvals:doc.vars});
}
@eightysteele
eightysteele / gist:1126818
Created August 5, 2011 02:33
WorldClim Metadata
variable,name,value
tmin3,DatabaseName,WorldClim
tmin3,Version,1.4
tmin3,Release,3
tmin3,Created,20060104
tmin3,Projection,GEOGRAPHIC
tmin3,Datum,WGS84
tmin3,MinX,30
tmin3,MaxX,60
tmin3,MinY,-30