This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import $ from 'jquery'; | |
// import Promise from 'rsvp'; | |
import DS from 'ember-data'; | |
export default DS.Adapter.extend({ | |
findRecord(store, type, id, snapshot) { | |
return {'imgURL': 'New Img comes here'}; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
var get = Ember.get; | |
var keys = Ember.keys; | |
var isNone = Ember.isNone; | |
/** | |
* Computed Property Macro returns computed property that evaluates to result of validation. | |
* | |
* It accepts rules hash which property name as keys and validation functions as values. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example usage: | |
import logger from "app/system/logger"; | |
var LOG = logger.loggerFor("topic"'); | |
LOG.log({ | |
event: "data received", | |
secondary: { | |
resource: "photo", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code co-ordinates tabs from the same domain to elect one of them as a | |
// "master", and allow them to broadcast messages to each other. | |
function WindowController () { | |
var now = Date.now(), | |
ping = 0; | |
try { | |
ping = +localStorage.getItem( 'ping' ) || 0; | |
} catch ( error ) {} | |
if ( now - ping > 45000 ) { | |
this.becomeMaster(); |