Skip to content

Instantly share code, notes, and snippets.

@scalabl3
scalabl3 / 1_instantiate.html
Last active March 18, 2016 01:29
Getting Started Tutorial for Using PubNub Presence with JavaScript
<!-- Include the PubNub Library -->
<script src="https://cdn.pubnub.com/pubnub.min.js"></script>
<!-- Instantiate PubNub -->
<script type="text/javascript">
var PUBNUB_demo = PUBNUB.init({
publish_key: 'demo',
subscribe_key: 'demo'
});
@scalabl3
scalabl3 / gist:8046965
Last active September 26, 2019 12:09
Install Elasticsearch 90.5 for Couchbase Integration on Mac via homebrew
These instructions are on Mac OS X, but it can easily be translated for any linux os too. The only differences will be to use default in elasticsearch.yml for vbuckets of 1024 (comment or take that line out). Also the paths to plugins, config, bin, etc. might be different as far as copying the couchbase_template.json over to config/templates.

On Mac I highly recommend just permanently increasing the max number of file descriptors allowed (unlimited is no longer a valid parameter):

$ cd /etc
$ vi launchd.conf
$ limit maxfiles 1000000 1000000
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@dustin
dustin / Dockerfile
Last active August 15, 2024 15:15
How I built couchbase 2.2 for docker
FROM ubuntu
MAINTAINER Dustin Sallings "[email protected]"
ADD http://cbfs-ext.hq.couchbase.com/couchbase-dist/couchbase-server-enterprise_2.2.0_x86_64.deb /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb
RUN apt-get update
RUN apt-get install -y librtmp0 python-httplib2
RUN dpkg -i /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb
RUN rm /tmp/couchbase-server-enterprise_2.2.0_x86_64.deb
RUN /etc/init.d/couchbase-server stop
@scalabl3
scalabl3 / gist:4274831
Created December 13, 2012 07:46
Example of a Range Query to query on two properties

Document Examples we'll Index (Map/Reduce)

Document #1 (key: mobie::001)

{
  doctype: "mobie",
  year: 2002,
  rating: 3
}
@scalabl3
scalabl3 / gist:3893563
Created October 15, 2012 16:50
Installing on Mac

Installing Couchbase Server and PHP or Ruby SDK's on Mac OSX

Order of Operations

  1. Handle post Mountain Lion upgrade if you had Homebrew
  2. Install/Upgrade Couchbase Server
  3. Install Homebrew (if you don't have it already)
  4. Install latest XCode
  5. Install XCode Command Line Tools
  6. Install libcouchbase C library
@nf
nf / hello-node.js
Created July 6, 2012 21:14
Hello world web server that scales across multiple processors
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', function(worker, code, signal) {