Skip to content

Instantly share code, notes, and snippets.

@rajagp
rajagp / gist:382f6f5c4c4f7aa8b703
Created October 7, 2014 16:56
Run script Build Phase to create a universal iOS8 framework using an aggregate target. The build target uses CocoaPods (so replace project/target with workspace/scheme).
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Replace with your scheme
SCHEME_NAME="MyScheme"
# Build Device and Simulator versions
xcodebuild ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -workspace "${PROJECT_DIR}/${PROJECT_NAME}.xcworkspace" -scheme ${SCHEME_NAME} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
@rajagp
rajagp / gist:3309edf21b2751637e7f89c260e8a7fb
Created September 28, 2016 01:50
iOS Run Script to Generate Aggregate multi-platform Framework (swift)
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: I am NOT the root invocation, so I'm NOT going to recurse"
else
@rajagp
rajagp / custom_couchbase_dev_image.md
Last active October 25, 2022 09:47
Steps to create a custom Couchbase Server Docker Image for development

Purpose

Follow the steps below if you are interested in creating your own custom configurable Couchbase docker image. You will start off with the official Couchbase Enterprise docker image that is available on Docker Hub and use the Couchbase CLI and REST interface to create a custom configurable image.

Credits

This approach inspired by the tutorial. We essentially built a custom docker image from the base Coucbase server image that is configured for our development needs!

Steps

  • Create a new file named DockerFile and open it using an editor of your choice
  • Now add the following lines to the DockerFile.
@rajagp
rajagp / Sample Java App with Couchbase Lite 1.4.4
Created April 3, 2019 21:09
Sample Java App with Couchbase Lite 1.4.4
//package com.couchbase.HelloWorld-Java;
import com.couchbase.lite.*;
import com.couchbase.lite.auth.Authenticator;
import com.couchbase.lite.auth.AuthenticatorFactory;
import com.couchbase.lite.replicator.Replication;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
@rajagp
rajagp / SGW-lo
Created May 10, 2019 18:46
SGW-Logs-Incoming-doc-with-docid-of-previously-deleted-doc
2019-05-10T18:41:41.265Z [DBG] SyncMsg+: c:[35d219ee] #4: Type:rev Id:doc1 Rev:3-a7947267ceb469e999e9141062592e2f685a3bf0 Sequence:5 User:admin
2019-05-10T18:41:41.268Z [DBG] CRUD+: c:[35d219ee] Invoking sync on doc "doc1" rev 3-a7947267ceb469e999e9141062592e2f685a3bf0
2019-05-10T18:41:41.269Z [DBG] CRUD+: Backed up revision body "doc1"/"2-6cc55e24e75c5f1d5a86ec6c833746a69725ec6c" (18 bytes, ttl:300)
2019-05-10T18:41:41.281Z [DBG] CRUD+: c:[35d219ee] Saving doc (seq: #38, id: doc1 rev: 3-a7947267ceb469e999e9141062592e2f685a3bf0)
2019-05-10T18:41:41.281Z [INF] CRUD: c:[35d219ee] Stored doc "doc1" / "3-a7947267ceb469e999e9141062592e2f685a3bf0" as #38
2019-05-10T18:41:41.281Z [DBG] SyncMsg+: c:[35d219ee] #4: Type:rev --> OK Time:29.6462ms User:admin
2019-05-10T18:41:41.281Z [DBG] WS+: c:[35d219ee] Push RPY#4
2019-05-10T18:41:41.281Z [DBG] WS+: c:[35d219ee] Sending frame: RPY#4 (flags= 1, size= 1)
2019-05-10T18:41:41.283Z [DBG] WS+: c:[35d219ee] Received frame: MSG#5 (flags= 0, length=93)
2019-
{
"syncgateway":{
"global":{
"resource_utilization":{
"admin_net_bytes_recv":697856009,
"admin_net_bytes_sent":166156024,
"error_count":9,
"go_memstats_heapalloc":55281624,
"go_memstats_heapidle":116293632,
"go_memstats_heapinuse":84017152,
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: sync-gateway-exporter
spec:
replicas: 1
template:
metadata:
labels:
app: sync-gateway-exporter
# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 2.81e-05
go_gc_duration_seconds{quantile="0.25"} 5.05e-05
go_gc_duration_seconds{quantile="0.5"} 8.92e-05
go_gc_duration_seconds{quantile="0.75"} 0.0001665
go_gc_duration_seconds{quantile="1"} 0.0004524
go_gc_duration_seconds_sum 0.0013899
go_gc_duration_seconds_count 9
# HELP go_goroutines Number of goroutines that currently exist.
{
"interface":":4984",
"log": ["*"],
"logging": {
"log_file_path": "/var/tmp/sglogs",
"console": {
"log_level": "debug",
"log_keys": ["*"]
},
"error": {
{
"adminInterface": ":4985",
"logging": {
"log_file_path": "/var/tmp/sglogs",
"console": {
"log_level": "debug",
"log_keys": ["*"]
},
"error": {
"enabled": true,