This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Helper from '@ember/component/helper'; | |
import { inject as service } from '@ember/service'; | |
export default Helper.extend({ | |
assetMap: service(), | |
compute(params) { | |
const [path] = params; | |
return this.assetMap.resolve(path); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
import RSVP from 'rsvp'; | |
export default DS.Adapter.extend({ | |
createRecord(store, type, snapshot) { | |
return RSVP.reject(new DS.InvalidError([{ | |
title: 'my_property', | |
detail: 'invalid_string', | |
source: { pointer: '/data/attributes/my_property' } | |
}])); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
import RSVP from 'rsvp'; | |
export default DS.Adapter.extend({ | |
createRecord() { | |
return RSVP.reject(new DS.InvalidError([ | |
{ | |
detail: 'Must be unique', | |
source: { pointer: '/data/attributes/name' } | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Retrieve author information as Git sees it while commiting | |
AUTHORINFO=$(git var GIT_AUTHOR_IDENT) || exit 1 | |
NAME=$(printf '%s\n\n' "${AUTHORINFO}" | sed -n 's/^\(.*\) <.*$/\1/p') | |
EMAIL=$(printf '%s\n\n' "${AUTHORINFO}" | sed -n 's/^.* <\(.*\)> .*$/\1/p') | |
REMOTE_ORIGIN_URL=$(git remote get-url origin) | |
# If we're trying to commit to repo with not allowed email | |
if [[ $REMOTE_ORIGIN_URL != *"<REPLACE_ME>"* ]] && [[ $EMAIL == *"<REPLACE_ME>"* ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"key": "shift+cmd+d", | |
"command": "editor.action.copyLinesDownAction", | |
"when": "editorTextFocus" | |
}, | |
{ | |
"key": "cmd+k t", | |
"command": "workbench.action.terminal.toggleTerminal" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { computed } = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
model: Ember.Object.create({ | |
profile: Ember.Object.create({ | |
toolbox: [], | |
activeToolbox: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
params:{ | |
key1: 'hello', | |
key2: 'world' | |
}, | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
links: [ | |
{ | |
name: 'Index Link', | |
params: ['index'] | |
}, { | |
name: 'Foo link', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
_internalAppName: 'Ember Twiddle', | |
longRunningTask: new Ember.RSVP.defer(), | |
appName: Ember.computed('_internalAppName', { | |
get() { | |
return this.get('_internalAppName'); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.store.query('model', { | |
param: 1 | |
}).then((records) => { | |
if (records.get('length') === 0) { | |
return new RSVP.reject(); | |
} | |
return records; | |
}).catch(() => { | |
// no records found | |
}).then((records) => { |