Skip to content

Instantly share code, notes, and snippets.

View kika's full-sized avatar

Kirill Pertsev kika

View GitHub Profile
#!/bin/sh
# this is written in sh not bash because I run it in the FreeBSD jail
# on a FreeNAS box
# directories 1 level under this root would be backed up, one backup file
# per firectory. Backup files would be named 'name of the directory'-'date'
# f.e. /mnt/data would be backed up as data-04-04-2015
# backup ignores all directories where it finds a file .gnutar.nobackup and all
# directories under it
ROOT=/mnt
@kika
kika / CGSSpaces.h
Last active January 2, 2018 12:31 — forked from puffnfresh/CGSSpaces.h
#include <Carbon/Carbon.h>
typedef void *CGSConnectionID;
extern CGSConnectionID _CGSDefaultConnection(void);
#define CGSDefaultConnection _CGSDefaultConnection()
typedef uint64_t CGSSpace;
typedef enum _CGSSpaceType {
kCGSSpaceUser,
kCGSSpaceFullscreen,

1. Introduction to the replicator database

A database where you PUT/POST documents to trigger replications and you DELETE to cancel ongoing replications. These documents have exactly the same content as the JSON objects we used to POST to /_replicate/ (fields "source", "target", "create_target", "continuous", "doc_ids", "filter", "query_params".

Replication documents can have a user defined "_id". Design documents (and _local documents) added to the replicator database are ignored.

The default name of this database is _replicator. The name can be changed in the .ini configuration, section [replicator], parameter db.

2. Basics

@kika
kika / gist:3845193
Created October 6, 2012 15:18
Bitter coffee
options = require( "optimist" )
.usage( "repro case" )
.check( (argv) ->
unless( argv )
throw "gonna die really soon"
)
.argv
## WTF below ##
runupload = (db, data, cb) ->