This file contains 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
You can do something like this: | |
@target host | |
GET /target => {... "update_seq": X, ...} | |
POST /_replicate {"source": "<source host>/source", "target": "target"} => {...} | |
GET /target/_changes?since=X => { //here are your replicated changes } | |
This last request to /target/_changes will also include any writes to the target database that occurred between the initial GET and /_replicate as well as any writes that occurred after the replication but before the /target/_changes request. If you can only make direct requests against the target database then it is impossible to guarantee an exact answer in the presence of concurrent updates to the target. | |
On the other hand, if you are performing a push replication from a local database or can otherwise afford to request changes from the source after the replication finishes, you can get exactly what you want even in the presence of concurrent updates to the source and/or the target using the response body from the replication request. |
This file contains 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
coffee> [{List, Just}, fs] = [(require './lib/monad'), (require 'fs')] | |
[object Object] | |
coffee> files = (List ['src', 'lib']).bind ((dir) -> Just (fs.readdirSync dir)) | |
[object Object] | |
coffee> files.log() | |
23 Feb 23:28:40 - [ [ 'monad.coffee~', 'list.coffee~', 'skuld.coffee~', 'skuld.coffee', 'monad.coffee' ], | |
[ 'skuld.js', 'monad.js' ] ] | |
[object Object] |
This file contains 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
> Array.isArray(Object.create(Array.prototype)) != Array.isArray(new Array()) | |
true |
This file contains 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
INLINE ATTACHMENT | |
{ | |
_attachments: { | |
"awesome.jpeg": { | |
content_type: "image/jpeg", | |
data: "base64 data goes here", | |
headers: { | |
"Access-Control-Allow-Origin": "*", | |
"Access-Control-Allow-Methods": "GET, POST, OPTIONS", |
This file contains 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/gunicorn/app/base.py b/gunicorn/app/base.py | |
index 6062117..a681420 100644 | |
--- a/gunicorn/app/base.py | |
+++ b/gunicorn/app/base.py | |
@@ -38,6 +38,7 @@ class Application(object): | |
self.callable = None | |
self.logger = None | |
self.do_load_config() | |
+ self.__handlers = None | |
This file contains 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/couch.js b/couch.js | |
index 26fb69e..21a6e82 100644 | |
--- a/couch.js | |
+++ b/couch.js | |
@@ -97,6 +97,198 @@ Dual licensed under the MIT and GPL licenses. | |
// END Math.uuid.js | |
+/** | |
+* |
This file contains 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
[["D", "CO", "Mark Udall", "MarkUdall"], ["R", "NM", "Stevan Pearce", "RepStevePearce"], ["R", "KY", "Rand Paul", "SenRandPaul"], ["R", "OH", "Jim Renacci", "RepJimRenacci"], ["R", "VA", "Scott Rigell", "RepScottRigell"], ["R", "FL", "David Rivera", "RepRivera"], ["R", "FL", "Dennis Ross", "RepDennisRoss"], ["R", "PA", "Joseph Pitts", "RepJoePitts"], ["R", "TX", "Ronald Paul", "RepRonPaul"], ["R", "IN", "Mike Pence", "RepMikePence"], ["R", "KS", "Pat Roberts", "SenPatRoberts"], ["R", "FL", "Ileana Ros-Lehtinen", "RosLehtinen"], ["R", "CA", "Edward Royce", "RepEdRoyce"], ["R", "NY", "Thomas Reed", "TomReedCongress"], ["R", "AL", "Martha Roby", "MarthaRoby"], ["R", "IN", "Todd Rokita", "ToddRokita"], ["D", "NH", "Jeanne Shaheen", "JeanneShaheen"], ["R", "AZ", "David Schweikert", "RepDavid"], ["R", "CO", "Scott Tipton", "RepTipton"], ["D", "NY", "Gary Ackerman", "RepGaryAckerman"], ["R", "AL", "Robert Aderholt", "Robert_Aderholt"], ["R", "MO", "W. Todd Akin", "ToddAkin"], ["R", "TN", "Lamar Alexander", "SenAlexa |
This file contains 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
[["R", "TN", "Lamar Alexander", "SenAlexander"], ["R", "NH", "Kelly Ayotte", "SenatorAyotte"], ["R", "WY", "John Barrasso", "SenJohnBarrasso"], ["D", "AK", "Mark Begich", "SenatorBegich"], ["R", "MO", "Roy Blunt", "RoyBlunt"], ["R", "AR", "John Boozman", "JohnBoozman"], ["D", "CA", "Barbara Boxer", "SenatorBoxer"], ["D", "OH", "Sherrod Brown", "SenSherrodBrown"], ["R", "NC", "Richard Burr", "SenatorBurr"], ["D", "WA", "Maria Cantwell", "US_Sen_Cantwell"], ["R", "IN", "Daniel Coats", "SenDanCoats"], ["R", "TN", "Bob Corker", "SenBobCorker"], ["R", "TX", "John Cornyn", "JohnCornyn"], ["R", "SC", "Jim DeMint", "JimDeMint"], ["R", "SC", "Lindsey Graham", "GrahamBlog"], ["R", "NV", "Dean Heller", "DeanHeller"], ["R", "NE", "Mike Johanns", "Mike_Johanns"], ["R", "WI", "Ron Johnson", "SenRonJohnson"], ["D", "SD", "Tim Johnson", "SenJohnsonSD"], ["R", "IL", "Mark Kirk", "markkirk"], ["R", "AZ", "Jon Kyl", "SenJonKyl"], ["R", "AZ", "John McCain", "SenJohnMcCain"], ["D", "MO", "Claire McCaskill", "clairecmc"], ["D", "N |
This file contains 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
chunkify(InList, BaseChunkSize) -> | |
%%io:format("length of list is ~p and chunk size is ~p ~n",[length(InList),BaseChunkSize]), | |
case byte_size(term_to_binary(InList)) of | |
Size when Size > BaseChunkSize -> | |
NumberOfChunksLikely = ((Size div BaseChunkSize) + 1), | |
ChunkThreshold = Size div NumberOfChunksLikely, | |
chunkify(InList, ChunkThreshold, [], 0, []); | |
_Else -> | |
[InList] | |
end. |
This file contains 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 is the call-with-current-continuation found in Scheme and other | |
* Lisps. It captures the current call context and passes a callback to | |
* resume it as an argument to the function. Here, I've modified it to fit | |
* JavaScript and node.js paradigms by making it a method on Function | |
* objects and using function (err, result) style callbacks. | |
*/ | |
Function.prototype.callcc = function(context /* args... */) { | |
var that = this, | |
caller = Fiber.current, | |
fiber = Fiber(function () { |