Skip to content

Instantly share code, notes, and snippets.

View vseventer's full-sized avatar

Mark van Seventer vseventer

View GitHub Profile
@vseventer
vseventer / index.html
Created March 4, 2014 16:51
Kinvey JavaScript library for Ember.js: loading.
...
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ember.js/1.4.0/ember.min.js"></script>
<script src="ember-data.js"></script>
<script src="//da189i1jfloii.cloudfront.net/js/kinvey-ember-2.0.0-beta.js"></script>
</body>
</html>
@vseventer
vseventer / application.js
Created March 4, 2014 16:56
Kinvey JavaScript library for Ember.js: adding an initializer.
// Replace `App Key` and `App Secret` with your application credentials.
var kinveyOptions = {
appKey : 'App Key',
appSecret : 'App Secret',
debug : true // Enable debug mode (development only).
};
// Add the Kinvey initializer.
Ember.Application.initializer({
name : 'kinvey',
@vseventer
vseventer / book.js
Created March 4, 2014 16:59
Kinvey JavaScript library for Ember.js: defining models.
// Define a `Book` model, and set the adapter to Kinvey.
App.Book = Kinvey.Model.extend({
// `Kinvey.Model` provides your models with three attributes:
// `acl`, `createdAt`, and `lastModifiedAt`. Add your own here.
author: DS.attr('string'),
title : DS.attr('string')
});
App.BookAdapter = Kinvey.RESTAdapter;
@vseventer
vseventer / user.js
Created March 4, 2014 17:02
Kinvey JavaScript library for Ember.js: defining users.
// Define the `User` model, and set the adapter to Kinvey.
App.User = Kinvey.User.extend({
// `Kinvey.User` extends `Kinvey.Model` and thus also provides your
// users with `acl`, `createdAt`, and `lastModifiedAt` attributes.
// In addition, the following attributes are set: `username`,
// `password`, `email`, `firstName`, `lastName`, `fullName`, and
// `isLoggedIn`. Add your own here.
dateOfBirth: DS.attr('date')
});
@vseventer
vseventer / angular-upload.html
Created May 27, 2014 16:34
Upload files through a form using Angular with Kinvey.
<doctype html5>
<div class="form-group" ng-controller="UploadCtrl">
<input type="file" class="form-control" ng-file-select="onFileUpload($files)" />
<button class="btn btn-success" ng-click="saveTruck()"> <span class="glyphicon glyphicon-ok"></span>&nbsp;Update Information</button>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script>
<script src="angular-file-upload.min.js"></script>
<script src="https://da189i1jfloii.cloudfront.net/js/kinvey-angular-1.1.8.js"></script>
<script>