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',
actions: {
clicked() {
alert('clicked!');
}
}
});
@runspired
runspired / discord-text-too-long.txt
Created Nov 24, 2019
I trimmed from 1974 characters down to these 1883. I was unable to post until below ~1895.
View discord-text-too-long.txt
This would simplify native class use in Ember
https://github.com/emberjs/ember.js/blob/v3.14.1/packages/%40ember/-internals/metal/lib/injected_property.ts#L73
Currently, due to the nature of `getOwner` things like inject can only be used on framework objects
what are your thoughts on a thing for enabling DI on non framework objects?
basically, with nice getters I don't feel objects need to be instantiated via the container anymore to use DI
and this would make just using native classes a lot of places pretty nice
View components.hero-table.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
@runspired
runspired / adapters.application.js
Last active Nov 15, 2019
Staggered Record Loading
View adapters.application.js
import Ember from 'ember';
import RSVP from 'rsvp';
export default Ember.Object.extend({
findRecord(_, __, id) {
return new RSVP.Promise(resolve => {
setTimeout(resolve, parseInt(id) * 350);
}).then(() => {
return {
data: {
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',
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({
});
You can’t perform that action at this time.