Skip to content

Instantly share code, notes, and snippets.

View ingenthr's full-sized avatar

Matt Ingenthron ingenthr

View GitHub Profile
@ingenthr
ingenthr / n1ql.go
Last active September 16, 2015 13:14
N1QL Query from Go
cluster, _ := gocb.Connect("couchbase://localhost")
bucket, _ := cluster.OpenBucket("default", "")
query := gocb.NewN1qlQuery("SELECT * FROM default")
rows := bucket.ExecuteViewQuery(query)
var row interface{}
for rows.Next(&row) {
fmt.Printf("Row: %+v\n", row)
}
@ingenthr
ingenthr / _README.md
Last active September 16, 2015 12:58 — forked from brett19/_README.md

This is a listing of various examples used for the Couchbase Go SDK GA Release Blog.

Blog Post

@ingenthr
ingenthr / NetJsonTranscoder.java
Created October 2, 2014 00:23
Sample of reading .NET JSON from Java with Couchbase
/**
* Copyright (C) 2014 Couchbase, Inc.
* Copyright (C) 2006-2009 Dustin Sallings
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@ingenthr
ingenthr / update user.py
Created January 15, 2014 02:01
to get syntax highlighting for a screenshot
""" Retrieve the user to change the email address """
user = cb.get("ingenthr")
""" Change the email and store the user """
user.value['email'] = "ingenthr@couchbase.com"
cb.set(user.key, user.value, cas=user.cas) # concurrent safe!
@ingenthr
ingenthr / Main.java
Last active December 28, 2015 06:59
A quick test to determine the number of threads created by a CouchbaseClient.
package com.couchbase.client.demo;
import com.couchbase.client.CouchbaseClient;
import java.io.IOException;
import java.net.URI;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/**
* Copyright (C) 2009-2013 Couchbase, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@ingenthr
ingenthr / Demo.java
Created September 3, 2013 23:25
Adjusting CouchbaseClient tuneables via CouchbaseConnectionFactoryBuilder.
/**
* Copyright (C) 2009-2013 Couchbase, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@ingenthr
ingenthr / gist:6132789
Created August 1, 2013 16:04
footerizing
---------
Copyright 2010-2013 Couchbase, Inc.
Learn more at <http://www.couchbase.com/communities/c>.
@ingenthr
ingenthr / README.md
Last active March 22, 2017 06:13
Various DTrace scripts for memcached

These are various scripts I've written in the past for tracing through memcached

LICENSE

The MIT License (MIT)

Copyright (c) 2013, Matt Ingenthron

Permission is hereby granted, free of charge, to any person obtaining a copy

@ingenthr
ingenthr / VbucketLookup.java
Created July 23, 2013 23:03
Sample of looking up the node associated with a given key on Couchbase.
/**
* Copyright 2013, Couchbase, Inc. All rights reserved.
*/
package com.couchbase.demo.vbucketlookup;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;