Skip to content

Instantly share code, notes, and snippets.

@pulsation
pulsation / replication_task.json
Last active December 21, 2015 17:49
CouchDB replication task that works with views, to be put in _replicator database.
{
"_id": "replication_task",
"source": "https://user:pass@example.iriscouch.com:6984/source-database",
"target": "target-database",
"user_ctx": {
"user": "admin",
"roles": [
"_admin"
]
},
@pulsation
pulsation / gist:6114018
Created July 30, 2013 15:30
Is the use of "val that = this" correct?
package eu.pulsation.alarmsandbox
import android.accounts.{AccountAuthenticatorActivity, AccountManager}
import android.os.Bundle
import android.app.Activity
import android.widget.{Button, EditText}
import android.view.View.OnClickListener
import android.view.View
import android.accounts.Account
@pulsation
pulsation / closure_inheritance.js
Last active December 11, 2015 16:09
Experimenting with javascript closures: inheritance
mynamespace = window.mynamespace || {};
mynamespace.Parent = function (param) {
var _privateProperty = param;
return {
getTwice : function () {
return _privateProperty * 2;
}
@pulsation
pulsation / gist:3853211
Created October 8, 2012 15:50
[Enyo+Cordova] Taking a picture with a phone and send it to a REST service such as a CouchDB database.
navigator.camera.getPicture(
function (imageData) {
var request = new enyo.Ajax({
url: "http://my_server_address:5984/mobility_camera_test/",
method: "POST",
handleAs: "json",
contentType: "application/json",
postBody: '{"image": "' + imageData + '"}'
});
request.go({});