Skip to content

Instantly share code, notes, and snippets.

View avsej's full-sized avatar
🛋️
On the couch

Sergey Avseyev avsej

🛋️
On the couch
View GitHub Profile
@devongovett
devongovett / gist:1039559
Created June 22, 2011 05:27
JSONDB implementation
###
# JSONDB - a compressed JSON format
# By Devon Govett
# Originally proposed by Peter Michaux - http://michaux.ca/articles/json-db-a-compressed-json-format
#
# jsondb.pack converts an array of objects with the same keys (i.e. from a database)
# and flattens them into a single array, which is much smaller than the pure json
# representation where the keys are repeated for each item in the array.
# Combine with JSON.stringify to send compressed JSON data over the network.
#
@avsej
avsej / .Xresources
Created September 30, 2011 05:53
Configure urxvt colors and key mappings
!URxvt*scrollstyle: plain
URxvt.scrollBar: False
URxvt.font: xft:DejaVu Sans Mono:pixelsize=11:antialias=true
URxvt.boldFont: xft:DejaVu Sans Mono:Bold:pixelsize=11:antialias=true
URxvt*foreground: #000000
!URxvt*background: #d3d7cf
URxvt*background: #dedede
! black
@avsej
avsej / repositories.rake
Created February 27, 2012 15:04
DEB/RPM repository maintenance script
# GistID: 1924422
# Author:: Couchbase <info@couchbase.com>
# 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
@ingenthr
ingenthr / StoreHandler.java
Created March 29, 2012 03:19
Sample of exponential backoff on a set with Couchbase Server
package com.couchbase.sample.dataloader;
import com.couchbase.client.CouchbaseClient;
import java.io.IOException;
import java.net.URI;
import java.util.List;
import net.spy.memcached.internal.OperationFuture;
import net.spy.memcached.ops.OperationStatus;
/**
@avsej
avsej / gist:2345830
Created April 9, 2012 19:20
nginx config for thin
upstream thin_cluster {
server unix:/var/run/thin.0.sock;
server unix:/var/run/thin.1.sock;
server unix:/var/run/thin.2.sock;
}
server {
server_name squish.demo.couchbase.com;
root /home/couchbase/couchbase-squish/public;
@avsej
avsej / .tmux.conf
Created May 10, 2012 06:26
My .tmux.conf
unbind C-b
set -g prefix C-t
### KEY BINDINGS
# first unbind, then bind: this allows on-the-fly config reloading (with C-r)
# quick tip: the '-r' flag means they can be pressed repeatedly
# note: I only added the shortcuts I use, please "man tmux" to go beyond
# find a window by name
unbind f
@avsej
avsej / .xinitrc
Created May 10, 2012 10:42
.xinitrc
#!/bin/sh
xset -b # disable bell
eval `/usr/bin/ssh-agent`
urxvtd &
wmname LG3D
GSDPID=`pidof gnome-settings-daemon`
if [ "x$GSDPID" == "x" ]; then
gnome-settings-daemon &
@davidjrice
davidjrice / README.md
Created June 6, 2012 17:00
Vagrantfile for an Ubuntu lucid 32 or 64 bit VM with couchbase 2.0.0.dp4.1

Install Virtualbox

wget http://download.virtualbox.org/virtualbox/4.1.16/VirtualBox-4.1.16-78094-OSX.dmg
open VirtualBox-4.1.16-78094-OSX.dmg
# double click .pkg to install

Install vagrant

gem install vagrant --no-ri --no-rdoc
@davidjrice
davidjrice / README.md
Created June 14, 2012 21:53
New Relic Instrumentation for Couchbase Ruby
  • Install & Setup New Relic
  • cd my_rails_project/config/initializers
  • wget http://raw.github.com/gist/2933202/5adcf11839c0ef2064a5f0c6e0fe795d9ed2c60a/couchbase_new_relic_instrumentation.rb
  • git add and deploy as usual!

Couchbase New Relic Instrumentation