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
// Prettier case statement, but can also return a value since it is an expression. | |
// | |
first_condition | |
? first_action() | |
: second_condition | |
? second_action() | |
: third_condition && can && (be || compound) | |
? action_3() | |
: default_action() |
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
reduce:function(key, values, rereduce) { | |
function addPropertiesTogether(addTo,addFrom){ | |
for (var prop in addFrom) { | |
(addTo[prop] !== undefined) ? addTo[prop] += Number(addFrom[prop]): addTo[prop] = Number(addFrom[prop]); | |
} | |
return addTo; | |
}; | |
return values.reduce(addPropertiesTogether,{}); | |
} |
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
commit 08b26333c44f9a86a8d9b87f4a1e6d51e9ac624c | |
Author: Jason Smith <[email protected]> | |
Date: Wed May 18 08:08:36 2011 +0700 | |
A configuration option httpd.cors_admin to allow _admin over CORS | |
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl | |
index db6809b..3193855 100644 | |
--- a/src/couchdb/couch_httpd.erl | |
+++ b/src/couchdb/couch_httpd.erl |
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
Currently, we can only grant dual read-write access in the _security | |
object "members" section. A user can either do both (name or role in | |
.members), or do neither (name and role not in .members). This | |
prevents a very common requirement for couch apps: sending private | |
information from less-privileged users to more-privileged users. There | |
is no (reasonable) way to make an "inbox" where anybody may create a | |
doc for me, but only I may read it. An inbox database allows | |
user-to-user, or user-to-admin private messages. (Don't think chat | |
messages. Think asynchronous notifications. With a per-user inbox, | |
think service requests and responses.) |
NewerOlder