Instantly share code, notes, and snippets.

View components.dynamic-select.js
import Ember from 'ember';
export default Ember.Component.extend({
// items: []
// model: {}
// relationshipName: ''
value: Ember.computed('model', 'relationshipName', function () {
return this.get(`model.${this.relationshipName}.id`)
}),
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
a: 'hello',
b: 'world',
filters: Ember.computed.collect('a', 'b'),
options1: Ember.computed('a', 'filters', function () {
View useful-audio
https://github.com/goto-bus-stop/get-artist-title
https://github.com/internet4000/media-now
https://github.com/internet4000/media-url-parser/
https://github.com/exogen/graphbrainz-extension-discogs
https://nelson.glitch.me
https://glitch.com/~record-player
http://everynoise.com/engenremap.html#hoodie
http://furia.com/newparticles/
http://everynoise.com/everydemo.cgi
http://everynoise.com/everyplace.cgi?root=Berlin%20DE&scope=all
View index.html
<div id="ytplayer"></div>
View components.my-form.js
import Ember from 'ember';
export default Ember.Component.extend({
router: Ember.inject.service('-routing'),
actions: {
submit() {
// validate stuff
console.log('hey');
this.get('router').transitionTo('my-route')
}
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View critical-css
1. yarn add critical --dev
2. copy paste this npm script
```
"scripts": {
"critical-css": "cat dist/index.html | critical --base dist/ --inline --minify > index.tmp && mv index.tmp dist/index.html"
}
```
View index.html
<style id="jsbin-css">
#app {
font-family: 'system-ui';
}
textarea {
width: 100%;
min-height: 10em;
padding: 0.5em;
line-height: 1.4;
}
View index.html
<div style=height:100% id=r4-loader><div style=background-color:#e6e6e4;top:0;left:0;right:0;bottom:0;position:fixed aria-label=Loading…><svg height=158 style=color:#888;fill:currentcolor;display:inline-block;max-width:100%;height:72px;position:absolute;top:0;left:0;right:0;bottom:0;margin:auto viewBox="0 0 369 158"width=369><g fill-rule=evenodd><path d="M352.606 44.05c-2.15-18.698-10.6-26.05-24.53-26.05C311.796 18 303 28.045 303 54.513c0 22.92 4.88 33.9 14.097 38.01 2.37 13.442 10.667 20.192 21.873 21.767 15.523 2.18 25.3-5.713 28.964-31.782 3.023-21.513-2.416-34.74-15.328-38.458zm0 0c.363 3.158.547 6.64.547 10.463 0 30.773-8.796 40.02-25.077 40.02-4.154 0-7.82-.6-10.98-2.01-.91-5.176-.944-11.346.075-18.595 3.295-23.443 16.257-32.83 31.78-30.648 1.278.18 2.497.436 3.656.77z"/><path d="M291.52 32.57c-4.616-19.75-14.395-27.276-28.855-26.518-18.844.987-28.31 15.136-26.43 51.01 1.545 29.483 7.413 44.122 17.376 49.822 3.845 7.714 10.166 11.895 17.982 13.133 16.105 2.55 30.037-8.75 35.216-41.445 4.063-25.657-2.777