Skip to content

Instantly share code, notes, and snippets.

View lukes's full-sized avatar

Luke Duncalfe lukes

View GitHub Profile
@lukes
lukes / models-mymodel.js
Created March 23, 2015 02:30
Ember DS.attr('object') -- (Allow declaring JSON as a valid property for an Ember model)
// save to app/models
import DS from "ember-data";
export default DS.Model.extend({
myProperty: DS.attr('object');
});
@lukes
lukes / application.js
Last active August 29, 2015 14:18
Reliably return the currentUser after login or app reload (with Ember simple-auth-devise)
// Save as routes/application.js
import Ember from 'ember';
import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin';
export default Ember.Route.extend(ApplicationRouteMixin, {
beforeModel: function(transition) {
this._super(transition);
@lukes
lukes / full-screen-mixin.js
Last active November 16, 2015 21:05
Ember FullScreenMixin
/*
Ember Mixin to fullscreen a component element's.
Ensures that an Esc key down will cancel fullscreen.
*/
import Em from 'ember';
export default Em.Mixin.create(Em.Evented, {
fullscreen: false,