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
function(doc){ | |
if (doc.summary) | |
index("subject", doc.summary, {"store" : "yes"}); | |
if (doc.description) | |
index("subject", doc.description, {"store" : "yes"}); | |
} |
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
// A `collection` representing a view result. View query parameters should be | |
// passed in via `cloudant_options`. | |
Backbone.Cloudant.View = { | |
Collection: Backbone.Cloudant.Collection.extend({ | |
// Name of the design document containing the view. | |
design: "my_design", | |
// Name of the view. | |
view: "my_view", | |
// Generate the correct base URL (without query parameters) for the view. |
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
foo = None | |
def bar(newfoo): | |
foo=newfoo | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Bootstrap --> | |
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> | |
</head> | |
<body> |
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
{ | |
"total_rows": 2, | |
"bookmark": "g1AAAACDeJzLYWBgYMpgTmGQS0lKzi9KdUhJMjTVyyrNSS3QS87JL01JzCvRy0styQGpS2RIsv___39WBpOb_efU3wlAsUR0zSa4NCc5AMmkepj-13G-D0D6GbIAvXEq-A", | |
"rows": [ | |
{ | |
"id": "[email protected]", | |
"order": [ | |
1.2123979330062866, | |
2 | |
], |
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
Backbone.Cloudant.database = "/sandbox/"; | |
// start the change handler | |
// Backbone.Cloudant.changeHandler(); | |
PeopleView = Backbone.View.extend({ | |
initialize: function () { | |
this.listenTo(this.collection, 'reset', this.render); | |
}, | |
template: _.template($("#person_template").html()), |
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
Backbone.Cloudant.database = "/sandbox/"; | |
// start the change handler | |
// Backbone.Cloudant.changeHandler(); | |
PersonView = Backbone.View.extend({ | |
initialize: function () { | |
this.render(); | |
}, | |
template: _.template($("#person_template").html()), |
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
// tuples shown instead of objects, for brevity | |
map output: | |
[id1, "a", null] | |
[id1, "a", null] | |
[id2, "a", null] | |
[id2, "b", null] | |
[id3, "b", null] | |
[id4, "c", null] |
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
$ curl -X GET -u XXXXX 'https://tengahdb.cloudant.com/sandbox/_design/extractmail.js' | |
{"_id":"_design\/extractmail.js","_rev":"7-708c30ba24efeabb5eb451c9412d4c96","views":{"all":"function(doc) { emit(doc._id, doc); } "}} | |
$ curl -X GET -u XXXXX 'https://tengahdb.cloudant.com/sandbox/_design/extractmail.js/_view/all' | |
{"error":"not_found","reason":"missing_named_view"} |
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
Python 2.7.2 (default, Jun 16 2012, 12:38:40) | |
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import json, requests | |
>>> | |
>>> url = 'http://maps.googleapis.com/maps/api/directions/json' | |
>>> | |
>>> params = dict( | |
... origin='Chicago,IL', | |
... destination='Los+Angeles,CA', |