Skip to content

Instantly share code, notes, and snippets.

@cyx
cyx / gsdeplode
Created March 8, 2013 22:46 — forked from djanowski/gsdeplode
#!/bin/sh
# Assuming you use gs(1) and dep(1), this program
# implodes your .gs directory and installs all gems
# listed in your .gems file with a single call to gem(1).
#
# gs(1): https://github.com/soveran/gs
# dep(1): https://github.com/cyx/dep
set -e
module JSON
class << self
alias :old_parse :parse
def parse(json, args = {})
args[:create_additions] = false
old_parse(json, args)
end
end
end
require "benchmark"
class A
def initialize(atts)
atts.each do |k,v|
instance_variable_set(:"@#{k}", v)
end
end
end
require "benchmark"
class A
def initialize(atts)
atts.each do |k,v|
instance_variable_set(:"@#{k}", v)
end
end
end
@cyx
cyx / redis_multiple
Created December 10, 2012 19:19 — forked from anonymous/redis_multiple
Multi node redis library
'''
Created on Jun 25, 2012
@author: andres.rangel
'''
import logging
import os
import re
from redis.client import Redis, BasePipeline, ConnectionError, StrictRedis, Script, NoScriptError
from redis.connection import ConnectionPool, Connection, DefaultParser
@cyx
cyx / master-slave.md
Created December 8, 2012 23:50
openredis - master slave

Setting up a slave

In order to setup an existing openredis instance as a slave of another existing instance, simply do the following:

  1. Access your [dashboard][dashboard].
  2. Click on Set as slave.
  3. Paste in the URL of your instance.
@cyx
cyx / master-slave.md
Created December 8, 2012 23:49
openredis - master slave

Setting up a slave

In order to setup an existing openredis instance as a slave of another existing instance, simply do the following:

  1. Access your [dashboard][dashboard].
  2. Click on Set as slave.
  3. Paste in the URL of your instance.
@cyx
cyx / gist:4232011
Created December 7, 2012 09:09 — forked from derekcollison/gist:4227635
Early results from high-performance NATS server
I have some early benchmark results for our work on a high performance NATS server in Go.

Quick Summary:
We can process ~2M msgs/sec through the system, and the ingress and egress are fairly well balanced.

The basics of the architecture are intelligent buffering and IO calls, fast hashing algorithms and subject distributor/routing, and a zero-allocation hand-written protocol parser.

In addition, I used quite a bit of inlining to avoid function overhead, no use of defer, and little to no object allocation within the fast path. I will share more details and the code at a future date.
@cyx
cyx / cli.md
Created December 3, 2012 07:56
CLI | openredis API docs

CLI API

If you need to access your instance publicly from your local computer, a coffee shop, or your office, you need to use our CLI API.

Note: This is the beta API and will probably change when we launch this publicly.

Getting your credentials

@cyx
cyx / backups.markdown
Created November 28, 2012 21:24
Backups How-to | openredis

Using the backup API

Using the openredis backup API, you can list, download, or restore the latest backup.

The following examples require that use your email and password for each curl call.

Important security note: Make sure you use the SSL endpoint in order to protect your credentials