Skip to content

Instantly share code, notes, and snippets.

@mnunberg
mnunberg / uvsync.py
Last active December 26, 2015 11:29
pyuv sync
from socket import getaddrinfo
from pyuv import Timer, Loop, TCP
from pyuv.error import UVError
from pyuv import errno as uv_errno
class NetworkError(Exception):
def __init__(self, uverr):
self.code = uverr
#
# Copyright 2013, Couchbase, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Copyright 2013, Couchbase, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@mnunberg
mnunberg / async.py
Last active December 24, 2015 04:59
txcouchbase
#
# Copyright 2013, Couchbase, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
/**
* Copyright 2012 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/**
* Copyright 2012 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mnunberg
mnunberg / couchbase.js
Last active December 21, 2015 15:19
(v2)
'use strict';
var couchnode = require('bindings')('couchbase_impl');
var util = require('util');
var CBpp = couchnode.CouchbaseImpl;
var CONST = couchnode.Constants;
var HOSTKEY_COMPAT = ['hosts', 'hostname', 'hostnames'];
/**
* Constructor.
var couchnode = require("bindings")("couchbase_impl");
var util = require("util");
var CBpp = couchnode.CouchbaseImpl;
var CONST = couchnode.Constants;
var HOSTKEY_COMPAT = ["hosts", "hostname", "hostnames"];
/**
* Constructor.
* @param options a dictionary of options to use. Recognized options
* are:
* "host": a string or an array of strings indicating the hosts to
var util = require('util');
var cb = require("./lib/couchbase.js");
var MAX_CLIENTS = 1;
var MAX_OPERATIONS=10000000;
var MODE_SEQUENTIAL = 1;
var MODE_
var CurrentOperations = 0;
var key = "keybase";
var value = "valbase";
#!/usr/bin/env python
import argparse
import subprocess
import os
import os.path
import multiprocessing
import sys
import shutil
import glob