Skip to content

Instantly share code, notes, and snippets.

View mixonic's full-sized avatar

Matthew Beale mixonic

View GitHub Profile

See emberjs/ember.js#19868

Download the tgz file below, and change your npm dependency on ember-source (in config/ember-try.js or just in package.json) to 'file:./ember-source-3.28.7-mixonic-explicit-injection-not-deprecated+ae15deb1.tgz'.

Three things for ember source 4.0, BLOCKS EMBER-CLI 4.0

Followup, can be a bit lazy:

@mixonic
mixonic / components.my-component.display-part.js
Created May 16, 2019 16:16
Component with re-usable content components
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
root: 'aa',
appName: Ember.computed('root', {
get() {
return this.get('root');
},
set(key, value) {
let newValue = value;
@mixonic
mixonic / controllers.application.js
Created May 3, 2019 14:04
Named export, default import
import Ember from 'ember';
import NamedExports from './exporting';
export default Ember.Controller.extend({
appName: NamedExports.appName
});
import Ember from 'ember';
export default Ember.Component.extend({
log: Ember.computed(() => []),
open() {
this.get('log').pushObject('opened!');
},
didInsertElement() {
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
function noOverride () {
// cannot override
}
const Parent = Ember.Controller.extend({
init() {
this._super();
if (this.__proto__.noOverride !== noOverride) {
@mixonic
mixonic / index.html
Last active September 15, 2017 21:07
set-function-prop-var (http://jsbench.github.io/#1d673c51707fd690ab4d749aaf125fcd) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>set-function-prop-var</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>