Skip to content

Instantly share code, notes, and snippets.

View jchris's full-sized avatar

Chris Anderson jchris

View GitHub Profile
@jchris
jchris / errors.log
Created April 6, 2014 13:48
errors with source build of CBL PhoneGap plugin
[phonegap] compiling iOS...
[phonegap] Generating config.xml from defaults for platform "ios"
[phonegap] Compiling app on platform "ios" via command "/Users/jchris/tmp/todo-lite-src/platforms/ios/cordova/build"
[error] An error occurred while building the ios project.2014-04-06 06:45:49.941 xcodebuild[14838:4007] DeveloperPortal: Using pre-existing current store at URL (file:///Users/jchris/Library/Developer/Xcode/DeveloperPortal%205.1.db).
2014-04-06 06:45:50.559 xcodebuild[14847:4007] DeveloperPortal: Using pre-existing current store at URL (file:///Users/jchris/Library/Developer/Xcode/DeveloperPortal%205.1.db).
2014-04-06 06:45:52.319 xcodebuild[14860:4007] DeveloperPortal: Using pre-existing current store at URL (file:///Users/jchris/Library/Developer/Xcode/DeveloperPortal%205.1.db).
2014-04-06 06:45:55.185 xcodebuild[14860:7303] DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-5067/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/SpecificationTy
@jchris
jchris / adb logcat
Last active August 29, 2015 13:56
crash app but replication continues
D/AndroidRuntime( 7412):
D/AndroidRuntime( 7412): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 7412): CheckJNI is OFF
D/dalvikvm( 7412): Trying to load lib libjavacore.so 0x0
D/dalvikvm( 7412): Added shared lib libjavacore.so 0x0
D/dalvikvm( 7412): Trying to load lib libnativehelper.so 0x0
D/dalvikvm( 7412): Added shared lib libnativehelper.so 0x0
D/dalvikvm( 7412): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
D/dalvikvm( 7412): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
E/memtrack( 7412): Couldn't load memtrack module (No such file or directory)
@jchris
jchris / gist:9062512
Created February 18, 2014 01:00
logcat.txt
D/CordovaWebView(26325): CordovaWebView is running on device made by: asus
D/JsMessageQueue(26325): Set native->JS mode to 2
D/CordovaActivity(26325): CordovaActivity.init()
D/CordovaWebView(26325): >>> loadUrl(file:///android_asset/www/index.html)
D/PluginManager(26325): init()
D/dalvikvm(26274): GC_CONCURRENT freed 348K, 4% free 9489K/9876K, paused 14ms+5ms, total 127ms
D/dalvikvm(26274): WAIT_FOR_CONCURRENT_GC blocked 75ms
W/System.err(26325): java.lang.ClassNotFoundException: com.couchbase.cblite.phonegap.CBLite
W/System.err(26325): at java.lang.Class.classForName(Native Method)
W/System.err(26325): at java.lang.Class.forName(Class.java:251)
@jchris
jchris / state-for-props.js
Created January 16, 2014 18:17
you implement this.setStateForProps(newProps, oldProps) and call this.setState() from there
exports.StateForPropsMixin = {
componentWillReceiveProps: function(newProps) {
// console.log("StateForPropsMixin componentWillReceiveProps", newProps, this.props)
this.setStateForProps(newProps, this.props)
},
componentWillMount: function() {
// console.log("StateForPropsMixin componentWillMount", this.props)
this.setStateForProps(this.props)
}
};
@jchris
jchris / index.html
Created January 14, 2014 23:33
Hello world with PeerJS
<html>
<head>
<title>PeerJS Hello</title>
</head>
<body>
<p>
Your peer id is: <span id="peerid"></span>
</p>
<form id="connect">
Connect to: <input type="text"/>
// object that emits changed events
// when watched fields are changed
var events = require('events'),
util = require("util");
//var myObj = new EventObject("fields", "to", "watch")
// doc = myObj.doc
// myObj.on("set", function(field){console.log("changed", field)})
// doc.watch = "foo"
/*
* hoax
* https://github.com/jchris/hoax
*
* Copyright (c) 2013 Chris Anderson
* Licensed under the Apache license.
*/
module.exports = function(request) {
var pax = require("pax");
@jchris
jchris / cblis.m
Created December 13, 2013 22:56
//
// CBLIncrementalStore.m
// CBLIncrementalStore
//
// Created by Christian Beer on 21.11.13.
// Copyright (c) 2013 Christian Beer. All rights reserved.
//
#import "CBLIncrementalStore.h"
var follow = require("follow"),
async = require("async"),
request = require("./json-client"),
rawRequest = require("request"),
docstate = require("docstate").control();
var adminDb = "http://localhost:4985/linkedin";
// download company data visible to different users
var requestLib = require("request"),
request = requestLib.defaults({
json:true
}, function(uri, options, callback){
var params = requestLib.initParams(uri, options, callback);
return requestLib(params.uri, params.options, function(err, res, body){
// treat bad status codes as errors
if (!err && res.statusCode >= 400) {
params.callback.apply(this, [res.statusCode, res, body]);
} else {