Skip to content

Instantly share code, notes, and snippets.

View tleyden's full-sized avatar

Traun Leyden tleyden

View GitHub Profile
build.gradle:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile project(':libraries:stubworld-corelib-sqlite4java')
compile project(':libraries:stubworld-corelib-android') {
exclude module: ':libraries:stubworld-corelib-android:libraries:stubworld-corelib-java'
}
}
@tleyden
tleyden / gist:8789472
Created February 3, 2014 18:27
json struct
type Generation struct {
start_time string
number int
state string
agents []Agent
games []Game
}
type GenerationJson struct {
Start_time string
@tleyden
tleyden / gist:9215525
Created February 25, 2014 19:12
couchbase-lite-android-ektorp tree
.
├── LICENSE.TXT
├── README.md
├── build
│   ├── bundles
│   │   ├── debug
│   │   │   ├── AndroidManifest.xml
│   │   │   ├── R.txt
│   │   │   ├── assets
│   │   │   ├── classes.jar
@tleyden
tleyden / gist:9215548
Created February 25, 2014 19:14
couchbase-lite-android-ektorp tree -L 4
.
├── LICENSE.TXT
├── README.md
├── build
│   ├── bundles
│   │   ├── debug
│   │   │   ├── AndroidManifest.xml
│   │   │   ├── R.txt
│   │   │   ├── assets
│   │   │   ├── classes.jar
@tleyden
tleyden / gist:9821497
Created March 27, 2014 23:29
Sync gateway crash checkers bot
6:23:14.302215 HTTP: #013: POST /checkers/_bulk_docs
16:23:14.302536 HTTP: #014: GET /checkers/_changes?feed=longpoll&heartbeat=300000&style=all_docs&since=91542&limit=100&filter=sync_gateway/bychannel&channels=game
16:23:14.308464 HTTP: #015: GET /checkers/user:076D9356-0711-44AC-8B8A-55748924E326 (ADMIN)
16:23:14.313421 HTTP: #016: GET /checkers/_changes?feed=longpoll&timeout=20000&since=91543 (ADMIN)
16:23:14.801578 HTTP: #017: GET /checkers/votes:checkers?rev=26339-b1875efcffceb3a693f00c90bb516a64&revs=true&attachments=true
16:23:14.801591 HTTP: #018: GET /checkers/game:checkers?rev=34360-1e2f438a9929a44c79fc49fc688ae969&revs=true&attachments=true
16:23:19.714674 HTTP: #019: PUT /checkers/_local/05b1d7a52d341f2e62c34fd4b085d232936b01fd
16:23:20.871836 HTTP: #020: PUT /checkers/_local/87e4a2d5a2b33f8bd97802038665255c9d7f521b
16:23:26.054957 HTTP: #021: POST /checkers/_revs_diff
16:23:26.091196 HTTP: #022: POST /checkers/_bulk_docs
@tleyden
tleyden / gist:11147841
Created April 21, 2014 16:27
sync gateway local config
{
"log": ["CRUD+", "REST+", "Changes+", "Attach+"],
"facebook" : {
"register" : true
},
"databases": {
"db": {
"server": "walrus:data",
"sync": `
function(doc){
@tleyden
tleyden / gist:11148026
Created April 21, 2014 16:33
sync gateway doc
hornet: ~$ http localhost:4984/grocery-sync/_all_docs
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Length: 157
Content-Type: application/json
Date: Mon, 21 Apr 2014 16:32:30 GMT
Server: Couchbase Sync Gateway/0.94
{
"rows": [
@tleyden
tleyden / gist:11148044
Created April 21, 2014 16:34
view doc
hornet: ~$ http localhost:4984/grocery-sync/8ecc5ef6-8ebf-437c-bf12-5bc4dc344200
HTTP/1.1 200 OK
Content-Length: 161
Content-Type: application/json
Date: Mon, 21 Apr 2014 16:33:36 GMT
Etag: 1-cdd6baa3-6916-444f-83e5-5608b7233dc0
Server: Couchbase Sync Gateway/0.94
{
"_id": "8ecc5ef6-8ebf-437c-bf12-5bc4dc344200",
{
"log": ["CRUD+", "REST+", "Changes+", "Attach+"],
"databases": {
"grocery-sync": {
"server": "walrus:data",
"sync": `
function(doc){
channel(doc.channels);
}`,
"users": {
@tleyden
tleyden / gist:11193162
Created April 22, 2014 20:28
Customize CouchbaseLiteHttpClientFactory
public MySSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
super(truststore);
TrustManager tm = new X509TrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}