Skip to content

Instantly share code, notes, and snippets.

Chris Thoburn runspired

Block or report user

Report or block runspired

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
data: Ember.computed(function() {
const owner = Ember.getOwner(this);
return owner.lookup('service:wat').getData();
})
@runspired
runspired / controllers.application.js
Last active Jul 2, 2019
Unknown Property Path Handling
View controllers.application.js
import Ember from 'ember';
const { computed } = Ember;
class FakeProxy {
constructor(target) {
this._target = target;
}
get(path) {
View gitfix.sh
# A handy utility for quickly forking and cloning and project
#
# Usage `gitfix <git-repo-link> [optional --no-install] [optional --no-fork]`
#
# What it does
# - forks the repository to the current user's GitHub renamed to <org-name>--<repo-name>
# - performs a shallow clone of the repository (last commit from master only) into `~/gitfix/<org-name>--<repo-name>`
# - the original repository will be the remote `origin`, the fork will be the remote `<github-username>`
# - changes the working directory to be `~/gitfix/<org-name>--<repo-name>`
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View components.display-list.js
import Ember from 'ember';
export default Ember.Component.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View adapters.application.js
import { Promise, defer, resolve } from 'rsvp';
export default class AppAdapter {
constructor(options) {
Object.assign(this, options);
}
static create(options) {
return new this(options);
}
@runspired
runspired / adapters.application.js
Last active Mar 20, 2019
Relationship Reload Issue
View adapters.application.js
import { Promise } from 'rsvp';
export default class AppAdapter {
constructor(options) {
Object.assign(this, options);
}
static create(options) {
return new this(options);
}
View adapters.application.js
import { Promise, defer } from 'rsvp';
let newID = 1;
export default class AppAdapter {
constructor(options) {
Object.assign(this, options);
}
static create(options) {
@runspired
runspired / adapters.application.js
Last active Mar 16, 2019 — forked from Alonski/controllers.application.js
ember-data belongsTo proxy unresolved REPL
View adapters.application.js
import EmberObject from '@ember/object';
import { resolve } from 'rsvp';
export default class ApplicationAdapter extends EmberObject {
findRecord() {
return resolve({
data: {
type: 'parent',
id: '1',
attributes: {
You can’t perform that action at this time.