Skip to content

Instantly share code, notes, and snippets.

View jchris's full-sized avatar

Chris Anderson jchris

View GitHub Profile
@jchris
jchris / gist:b005b40bca9e6d16b287
Last active August 29, 2015 14:07
paleo recipes

Banana pancakes:

1 banana, 2 eggs, vanilla, cinnamon Immersion blend (pull air into the batter to make them fluffier) and cook like pancakes. you can also add 1/2 a leftover sweet potato for thicker pancakes.

"meatza":

1 part hamburger 1 part pork sausage, press flat in an iron skillet, bake in the oven ~375. Drain off juice, add mozzarella cheese (I like to use grated hard mozzarella AND fresh soft mozzarella balls) and red sauce, cook some more. Add other pizza toppings.

@jchris
jchris / notes.md
Created October 10, 2014 17:50
notes on CouchDB storage

CouchDB storage bulk docs update flow based on this code.

  • separate out the NonRep documents from the rest of the documents
  • lookup up the old documents, if they exist.
  • Merge the new docs into the revision trees (passed the current seq)
    • this applies the seq number to the documents being written
    • this also finds the obsolete seq nums we can drop
  • update local docs (NonRep docs)
    • they have their own by-id tree, no by-seq tree
  • simpler revs
@jchris
jchris / test.Document.js
Created July 30, 2014 00:46
tests for CBL Document class
// tests for cbl.Document
"use strict";
var cbl = require(".."),
util = require("./util");
// Document
// A Couchbase Lite Document.
//
util.test("Document: Properties", function(t){
@jchris
jchris / detuned-wavepot-verge.js
Created June 17, 2014 19:07
changed some ints to floats.
/*!
*
* stagas - on the verge (tech mix)
*
*/
var bpm = 125;
var tuning = 440;
var transpose = 12;
var coax = require("coax"),
server = coax("https://localhost:59840/"),
database = server("tmp-test");
database.put(function(err, ok){
console.log("create db", err, ok)
var ddocID = "_design/foo"
database(ddocID, function(err, ddoc){
if (err) {
ddoc = {}
var dc = require(".."),
// make wallets
var giver = {
"nickname" : "test-giver",
"keypair" : RS512_GIVER_KEY_PAIR
}
var receiver = {
"nickname" : "test-receive",
@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)
}
};