Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am cnandreu on github.
  • I am cnandreu (https://keybase.io/cnandreu) on keybase.
  • I have a public key ASCuzxRPg3pAi_2FV_tvztGNNU26xZ2cfzdkBeYzWlEOeAo

To claim this, I am signing this object:

function wlCommonInit () {
var collectionName = 'people';
var collections = {
people : {
searchFields : {name: 'string', age: 'integer'}
}
};
@cnandreu
cnandreu / main.js
Created February 21, 2015 22:27
Code used in the "MobileFirst Platform v6.3 JSONStore CLI Installation" Youtube Video (https://www.youtube.com/watch?v=OndEumD9VMs&hd=1)
function wlCommonInit () {
var collectionName = 'people';
var collections = {
people : {
searchFields : {name: 'string', age: 'integer'}
}
};
@cnandreu
cnandreu / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
asyncTest('StackOverflow Question', function () {
var collections1 = {
people : {
searchFields : {name: 'string', age: 'integer'}
}
};
var options1 = {
username: 'ad2tst',
04-11 14:48:34.235: D/webkit-timers(2291): [JWebCoreJavaBridge::resume] >> do resume
04-11 14:48:34.346: D/CordovaWebViewClient(2291): onPageFinished(file:///android_asset/www/skinLoader.html)
04-11 14:48:34.346: D/CordovaActivity(2291): onMessage(onPageFinished,file:///android_asset/www/skinLoader.html)
04-11 14:48:34.346: D/skia(2291): SwapPlugins [MainUrl] file:///android_asset/www/skinLoader.html
04-11 14:48:34.476: D/dalvikvm(2291): GC_CONCURRENT freed 318K, 47% free 3202K/6023K, external 294K/806K, paused 3ms+2ms
04-11 14:48:34.576: D/dalvikvm(2291): GC_CONCURRENT freed 281K, 45% free 3495K/6279K, external 294K/806K, paused 2ms+2ms
04-11 14:48:34.896: D/CordovaActivity(2291): onMessage(spinner,stop)
04-11 14:48:35.016: D/CordovaNetworkManager(2291): Connection Type: none
04-11 14:48:35.016: D/CordovaActivity(2291): onMessage(networkconnection,none)
04-11 14:48:35.016: D/CordovaNetworkManager(2291): Connection Type: none
function wlCommonInit() {
var collections = {
people : {
searchFields: {name: 'string'}
}
};
WL.JSONStore.destroy()
.then(function () {
var testTask = function () {
WL.Logger.debug('Start Test03');
WL.JSONStore.get('myCollection').count() //returns a promise
.then(function (cnt) {
WL.Logger.debug('Test03 Then count:', cnt);
return otherTask(); //returns a promise
@cnandreu
cnandreu / main.js
Created January 14, 2014 16:17
quick jsonstore sample code
function wlCommonInit(){
//The code below must run after the deviceready event (inside wlCommonInit or after)
var collections = {
customers : {
searchFields : {
'CUSTOMERCODE' : 'string'
}
}
@cnandreu
cnandreu / invokePromises.js
Created September 17, 2013 02:34
WL.Client.invokeProcedure with promises
//Code to invoke adapters using promises
var invokeAdapterWithPromises = function (adapterName, procedureName, params) {
var deferred = $.Deferred(),
invocationData = {
adapter : adapterName,
procedure : procedureName,
parameters : params
};