Skip to content

Instantly share code, notes, and snippets.

View ingenthr's full-sized avatar

Matt Ingenthron ingenthr

View GitHub Profile
@dustin
dustin / flume.py
Created July 27, 2010 21:05
tap -> flume
#!/usr/bin/env python
#
# tap -> flume
#
# requires: python thrift bindings + compiled flume thrift binding.
#
import sys
import time
import struct
import multiprocessing
import sys
from multiprocessing import JoinableQueue
from multiprocessing import Pipe
from multiprocessing import Queue
from multiprocessing import Process
from pylibmc import Client
from time import sleep
//Changes filter: "conflicts": "function(doc, req) { if(doc._conflicts) { return true; } else { return false; }}"
var dbase = 'focus';
var ddoc = 'app';
var sys = require('sys'),
couchdb = require('node-couchdb/lib/couchdb'),
client = couchdb.createClient(5984, 'crate.im'),
db = client.db(dbase),
changes = db.changesStream({filter: ddoc + '/conflicts'});
@dustin
dustin / post-fetch
Created December 16, 2010 23:44
My post fetch hook for gitmirror running doxygen.
#!/bin/sh
PATH=$PATH:/usr/local/bin
export PATH
T=$HOME/Sites/doxygen/ep-engine
H=/Users/dustin/prog/ep-engine
git fetch
branches=`git branch | cut -c3- | egrep -v "z|gh-pages"`
@dustin
dustin / perftest.py
Created January 18, 2011 19:31
ep-engine strategy performance test thing
#!/usr/bin/env python
import os
import sys
import time
import glob
import string
import random
import subprocess
@mikewied
mikewied / java-couchbase-api
Created July 5, 2011 20:00
Java Couchbase API
===========
Examples:
===========
CouchbaseClient couchbase_client = new CouchbaseClient(Arrays.asList(URI.create("http://localhost:8091/pools")), "default", "");
// Get views from a design document
List<View> views = couchbase_client.getViews("design_doc_name");
// Get a single view from the server
<?php
$cb = new Couchbase;
$cb->addServer("localhost", 11211); // BC compat
$view = $cb->getView("ddocname", "viewname"); // returns Couchbase_View
$result = $view->getResult(); // returns Couchbase_ViewResult
foreach($result->rows AS $row) {
echo $row->value;
}
@isopov
isopov / BasicAuthTest.java
Created September 30, 2011 15:20
Sample for using basic authentication with Netty.
import java.net.InetSocketAddress;
import java.util.concurrent.Executors;
import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
@avsej
avsej / repositories.rake
Created February 27, 2012 15:04
DEB/RPM repository maintenance script
# GistID: 1924422
# Author:: Couchbase <[email protected]>
# Copyright:: 2011, 2012 Couchbase, Inc.
# License:: Apache License, Version 2.0
#
# 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