Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Anderson jchris

View GitHub Profile
View for sale
⌚️📸📺🔭💎🎥🏰🏍🛴🚲🎸🎻🛹🌂
View paginate2.js
import faunadb, {query as q} from 'faunadb'
const client = new faunadb.Client({
secret: "x"
});
// jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000
async function runThese() {
var edits = 20
View paginate.js
import faunadb, {query as q} from 'faunadb';
const client = new faunadb.Client({
secret: "XXXXXX"
});
async function runThese() {
const ref = q.Ref(q.Class("posts"), 6)
@jchris
jchris / faunadb-local-hello.js
Last active Jul 13, 2017
connect to FaunaDB Developer Edition on localhost
View faunadb-local-hello.js
var faunadb = require("faunadb");
var q = faunadb.query;
var client = new faunadb.Client({
secret: "secret",
scheme: 'http',
domain: '127.0.0.1',
port: 8443
})
@jchris
jchris / example.go
Created Nov 14, 2016
Executable example for FaunaDB Go release blog post
View example.go
package main
import (
"fmt"
f "github.com/faunadb/faunadb-go/faunadb"
)
// I guess we can blog about how easy is to integrate your data structures with fauna using the go driver
// which, in my opinion, is one of the easiest so far.
@jchris
jchris / portfolio.md
Last active Oct 13, 2016
Code Portfolio
View portfolio.md

This is a non-exhaustive list of (mostly) open source work in roughly chronological order. Most of my production code is in Erlang, JavaScript, and Go, with application code in JavaScript, Objective-C, and C#. The theme that emerges is a focus on developer experience, and on pushing the envelope for edge compute.

Ruby on Rails

Apache CouchDB _users database

View _README.md

This is a listing of various examples used for the Couchbase Go SDK GA Release Blog.

Blog Post

@jchris
jchris / Couchbase Lite with React Native.md
Last active May 4, 2018
Couchbase Lite with React Native
View Couchbase Lite with React Native.md

Couchbase Lite with React Native

I went into this expecting a challenge but it was easy. Basically, Couchbase Lite has always had an optional HTTP listener that you can connect to from inside your app at http://lite.couchbase./mydatabase/. React Native has a fine XHR module and encourages using fetch so getting your app to sync can be as easy as adding some API calls to keep JSON in the database.

We haven't done a full example yet, but in the spirit of possiblity, here are quick instructions to connect Couchbase Lite iOS with a React Native app (generated from their cli).

View startListener.swift
// MARK: - Listener
func startListener() -> Bool {
if listener != nil {
return true
}
var error: NSError?
listener = CBLListener(manager: CBLManager.sharedInstance(), port: 0)
// Enable Basic Authentication
View cbl log
2015-02-09 13:55:51.265 TodoLite[25539:1536873] Apache Cordova native platform version 3.7.0 is starting.
2015-02-09 13:55:51.265 TodoLite[25539:1536873] Multi-tasking -> Device: YES, App: YES
2015-02-09 13:55:51.268 TodoLite[25539:1536873] Unlimited access to network resources
2015-02-09 13:55:51.271 TodoLite[25539:1536873]
Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file
You can’t perform that action at this time.