Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan rondale-sc

View GitHub Profile
View components.my-component\.js
import Component from '@glimmer/component';
export default class extends Component {
}
View inline-svg-helper.js
// src/utilities/inline-svg/helper.js
// @ts-ignore:
import { svgs } from '../../../utils/svgs';
function dottify(path) {
return (path || '').replace(/^\//g, '').replace(/\//g, '.');
}
export default function inlineSvg([path]) {
View controllers.application.js
import Ember from 'ember';
import { inject as service } from '@ember/service';
import { getOwner } from '@ember/application';
export default Ember.Controller.extend({
routerService: service('router'),
appName: 'Ember Twiddle',
actions: {
actionOne() {
this.get('routerService').transitionTo('foo.bar.my-route', 1, { queryParams: { foo: 1 }});
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 components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
someComputed: Ember.computed('structure.subscriptions.[]', function() {
return 'Some Computed: ' + this.get('structure.subscriptions.firstObject.name');
})
});
View components.my-fake-checkbox.js
import Ember from 'ember';
export default Ember.Component.extend({
checked: false,
isVisible: true
});
View setup-syntastic-eslint.md

Syntastic setup:

Install:

vim-syntastic/syntastic

Add the following to ~/.eslintrc

{
View contact.js
import DS from 'ember-data';
export default DS.JSONSerializer.extend({
normalize(typeClass, hash) {
// return JSON API document
},
pushPayload(store, payload) {
let normalizedPayload = this.normalize(typeClass, payload);
return this._super(store, normalizedPayload);
}
View fastboot-launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Fastboot",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/.bin/ember",
"stopOnEntry": false,
"args": ["fastboot", "--serve-assets"],