This file contains hidden or 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
var pearlJam = { | |
members: [ | |
{ firstName: 'Eddie', lastName: 'Vedder' }, | |
{ firstName: 'Mike', lastName: 'McCready' }, | |
{ firstName: 'Jeff', lastName: 'Ament' }, | |
] | |
} | |
let { members: [ eddieVedder ] } = pearlJam; | |
let { firstName: eddie } = eddieVedder; |
This file contains hidden or 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
export default Model.extend({ | |
name: DS.attr(), | |
frienderFriendships: DS.hasMany('friendship', { inverse: 'friender' }), | |
friendedFriendships: DS.hasMany('friendship', { inverse: 'friended' }), | |
friendships: Ember.computed('frienderFriendships', 'friendedFriendships', function() { | |
let friendedFriendshipsRel = this.hasMany('friendedFriendships'); | |
let frienderFriendshipsRel = this.hasMany('frienderFriendships'); | |
let frienderFriendships; |
This file contains hidden or 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
model(params) { | |
return this.store.findRecord('person', params.person_id) | |
.then((person) => { | |
return { | |
friendships: person.get('friendships', { include: 'friender,friended' }), | |
person | |
}}); | |
}, |
This file contains hidden or 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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or 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
$.domReady(function(){ | |
// Fire an event so that GA doesn't count it as a "bounce" | |
// http://blog.popcornmetrics.com/why-your-google-analytics-bounce-rate-is-wrong-and-how-to-fix-it/ | |
function readPage() { | |
ga('send', { | |
'hitType': 'event', | |
'eventCategory': 'engagement', | |
'eventAction': 'read' | |
}); | |
} |
This file contains hidden or 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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.bordered { | |
border: 1px solid blue; | |
height: 100px; | |
} |
This file contains hidden or 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'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
// value: 'Over The Hills' | |
value: null, | |
}); |
This file contains hidden or 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
<!doctype HTML> | |
<title>D3 Test</title> | |
<script src="d3.v3.min.js" charset="utf-8"></script> | |
<style type="text/css"> | |
body { | |
margin:0 auto; | |
position:relative; | |
width:958px; | |
} | |
.chart rect { |
This file contains hidden or 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
/* jshint node: true */ | |
const contentSecurityPolicy = { | |
'default-src': "'none'", | |
'script-src': "'self'", | |
'font-src': "'self'", | |
'connect-src': "'self' localhost:*", | |
'img-src': "'self'", | |
'style-src': "'self' 'unsafe-inline'", | |
'media-src': "'self'" | |
}; |
This file contains hidden or 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
Designing component hierarchies in Ember had historically somewhat | |
tortuous but with the arrival of block parameters (1.10) and closure | |
actions (1.12), the difficulties have been vastly mitigated. I take a | |
slightly complex example, that of an autocomplete input, and show how to | |
go about implementing a nested component hierarchy in Ember and how the | |
aforementioned features and others help us pull it off. |