Skip to content

Instantly share code, notes, and snippets.

@mnunberg
mnunberg / gitssh.pl
Created August 11, 2012 20:13
Simple script for using git with alternate ssh keys
#!/usr/bin/perl
# This script makes dealing with alternate SSH keys. Rather than
# doing something retarded like mangling your git or ssh settings
# for automated tasks, you can simply use this script..
# It will create a temporary executable shell script (templated below)
# and delete it when it's done.
#
# It requires the GITREPO_KEYFILE environment variable to be set to the
# path of your ssh private key.
# Otherwise, this script will blindly pass arguments to git(1)
@mnunberg
mnunberg / 6bit.c
Created August 13, 2012 08:21
couchbase flags proposals
/**
*
*/
/**
* Couchbase Datatype Flags
*
* These flags help to disambiguate the format and compression of values.
*
@mnunberg
mnunberg / gist:3782572
Created September 25, 2012 15:23
CouchbaseView.php
<?php
class CouchbaseView {
/**
* These constants are view options. They are symbolic names for string
* parameters passed as partm of the query string
*/
const VOPT_STALE = "stale";
const VOPT_START_DOCID = "startkey_docid";
/**
* Create some view options..
*/
lcb_view_option_t opt_stale;
lcb_view_option_t opt_onerr;
lcb_view_option_t opt_limit;
lcb_view_option_t opt_invalid;
lcb_view_option_t *optlist[] = {
&opt_stale,
#include <libcouchbase/couchbase.h>
#include "viewrow.h"
#include "viewopts.h"
#include <stdio.h>
#undef NDEBUG
#include <assert.h>
#include <sys/stat.h>
diff --git a/src/event.c b/src/event.c
index f474f05..841a1b9 100644
--- a/src/event.c
+++ b/src/event.c
@@ -295,6 +295,7 @@ void lcb_server_event_handler(lcb_socket_t sock, short which, void *arg)
{
lcb_server_t *c = arg;
(void)sock;
+ short which_new = LCB_READ_EVENT;
@mnunberg
mnunberg / output
Created June 5, 2013 23:37
gevent+couchbase
#!/usr/bin/env python
import gevent
import gevent.monkey; gevent.monkey.patch_all()
from threading import Lock
import sys
from couchbase.libcouchbase import Connection
from couchbase.iops.select import SelectIOPS
@mnunberg
mnunberg / pycbc-winbuild.py
Last active October 25, 2017 09:49
Build script for Python couchbase client.
#!/usr/bin/env python
import os
import os.path
import sys
import argparse
import urllib2
import zipfile
import shutil
import glob
import subprocess
#!/usr/bin/env python
import argparse
import subprocess
import os
import os.path
import multiprocessing
import sys
import shutil
import glob
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";