Skip to content

Instantly share code, notes, and snippets.

class Todo extends Backbone.Model
class TodoList extends Backbone.Collection
class Todo extends KinveyModel
class TodoList extends KinveyCollection
events:
"keypress #filter-string" : "filterOnEnter"
idAttribute: '_id'
auth = $.base64.encode( "#{kinvey_app_key}:#{kinvey_master_secret}" ")
jqueryXHR.setRequestHeader("Authorization", "Basic #{auth}")
addAll: =>
// make sure to clear the list first!
@$("#todo-list").empty()
Todos.each(@addOne)
filterOnEnter: (e) ->
if e.keyCode is 13
Todos.filterString = @$("#filter-string").val()
Todos.fetch()
// We use a separate function rather than defining this
// twice: once for the Model, and once for the Collection
kinveyAuthenticatedSync = (method, model, options) ->
// Before we send the request ...
options.beforeSend = (jqXHR) ->
// Add the Basic Authentication header
jqXHR.setRequestHeader(
'Authorization',
public class UploadVideoActivity extends Activity {
private KCSClient sharedClient;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the shared instance of the Kinvey Service client
sharedClient = ((KinveyVidUploadApp) getApplication()).getKinveyService();
@KellyRice
KellyRice / fireAtWill.js
Created January 31, 2012 17:55
Mark code 4
// User ID
var _id;
// Handler to be executed when all dependencies are done
document.addEventListener('appready', function() {
kinvey.user.fetch(_id, function(user) {
// User found, go ahead and render page
});
}, false);