Skip to content

Instantly share code, notes, and snippets.

@HodGreeley
HodGreeley / AsciiDocTips.adoc
Last active November 15, 2019 22:54
Tips for using AsciiDoc

Tips for using AsciiDoc

Command line processing:

asciidoctor -a allow-uri-read -b html5 blogpost.adoc
@HodGreeley
HodGreeley / gist:a298336b9425a31560f669468d2cf7f1
Last active August 9, 2018 14:22
macOS command line to create user to run a service
# Use these to see the current list of users and groups, to select unique user and groud ids.
dscacheutil -q user | awk 'BEGIN { ORS="" } /name/ { print $2 " " } /uid/ { print $2 "\n" }' | sort -unk 2
dscacheutil -q group | awk 'BEGIN { ORS="" } /name/ { print $2 " " } /gid/ { print $2 "\n" }' | sort -unk 2
# I chose 400 for both uid and gid based on what's in use on my own machine.
# DO NOT use 400 without checking it's available first.
sudo dscl . -create /Groups/_sync_gateway
sudo dscl . -create /Groups/_sync_gateway PrimaryGroupID 400
@HodGreeley
HodGreeley / poi.js
Last active July 26, 2018 21:05
Couchbase Points of Interest Eventing Service Functions Code
function OnUpdate(doc, meta) {
if (meta.id !== 'trigger') return;
let here = db['here'];
let url = "https://places.cit.api.here.com/places/v1/discover/around";
let data = `app_id=${here.id}&app_code=${here.code}&at=${doc.lat},${doc.lon}`;
let query = SELECT CURL($url, {
@HodGreeley
HodGreeley / README-Couchbase-Docker.adoc
Last active July 7, 2022 14:42
Docker Scripts to Simplify Setup with Couchbase

Docker Scripts to Simplify Setup with Couchbase

@HodGreeley
HodGreeley / Android Java Source
Created February 24, 2018 00:23
Storing Objects in a JSONArray with Java
package com.couchbase.mobile;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import com.couchbase.lite.Database;
import com.couchbase.lite.DatabaseConfiguration;
import com.couchbase.lite.MutableDocument;
import com.fasterxml.jackson.core.type.TypeReference;
@HodGreeley
HodGreeley / sync_gateway_spec.json
Created February 16, 2017 01:20
Sync Gateway Swagger spec
{
"swagger": "2.0",
"info": {
"title": "Sync Gateway",
"description": "Documentation for the Sync Gateway Admin REST API. This page is generated from the Sync Gateway Admin Swagger spec, the exact same information is also available at [developer.couchbase.com/mobile/swagger/sync-gateway-admin](http://developer.couchbase.com/mobile/swagger/sync-gateway-admin/).\n",
"version": "1.3"
},
"host": "localhost:4985",
"schemes": [
"http",