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
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
There is no crud in play 2. Here are your options: Sample Code. The samples like "ZenTasks" for front end, "Computer Database" for backend, and "Forms" for form stuff contain example code that can … be quickly manipulated. Not as nice as real crud but you take what you can get. http://www.playframework.org/documentation/2.0/Samples glitter8. Current recommendations from forums are to use … |
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
ERROR: push failed while processing /Users/rbp/Projects/tengahdb/tengah: {'EXIT',{{badmatch,{error,{ok,"400", | |
[{"X-Couch-Request-ID","db7588bf"}, | |
{"Server","CouchDB/1.0.2 (Erlang OTP/R14B)"}, | |
{"Date","Wed, 27 Feb 2013 16:20:40 GMT"}, | |
{"Content-Type","application/json"}, | |
{"Content-Length","72"}, | |
{"Cache-Control","must-revalidate"}], | |
<<"{\"error\":\"bad_request\",\"reason\":\"Attachment name can't start with '_'\"}\n">>}}}, |
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
cat Worker.py | |
class Worker(object): | |
def work(self): | |
pass | |
(tengahdb)rbp-imac-3:tengahdb rbp$ python | |
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. | |
>>> module = __import__("Worker") | |
>>> print module, dir(module) |
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
text-align: left; | |
.table th, .table td - left | |
.table th, .table td - left | |
.text-right - right | |
.stat-freq - right | |
.text-right - right | |
table - start user agent stylesheet |
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
{ "_id" : ObjectId( "5191651568f1f6000282b81f" ), | |
"updated_at" : "2013-05-16T09:46:16.199660", | |
"activities" : [ | |
{ "worker_name" : "image", | |
"worker_version" : 1, | |
"completed_at" : "2013-05-13T21:34:59.293711" }, | |
{ "worker_name" : "image", | |
"worker_version" : 1, | |
"completed_at" : "2013-05-16T07:33:22.550405" }, | |
{ "worker_name" : "image", |
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
class mybase: | |
derived_from = None | |
def set_derived_from(self, derived): | |
this.derived_from = derived | |
def derived(fn): | |
def wrapped(self, other): | |
att = fn(self, other) |
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
counts = Metadata.group(key={'metadata_type':1}, | |
condition={"owner" : self.owner.id, | |
"attributes.attribute_type" : {"$in", self.md_fields} | |
}, | |
initial={"count":0}, | |
reduce_f="""function (current, result) { result.count++}""", | |
finalize_f=None) |
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 time | |
class uTimer(object): | |
def __enter__(self): | |
self.begin_time=time.time() | |
self.end_time=0.0 | |
self.delta=0.0 | |
def __exit__(self, type, value, tb): |