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
export PATH="$PATH:$HOME/.npm-packages/bin" | |
alias cdwww="cd ~/Downloads/www" #This might be risky. If you choose to have your www directory in ~/Downloads, use version control to backup your projects frequently! ChromeOS might wipe the Download folder if there is data space shortage | |
alias cdd="cd ~/Downloads" | |
alias x="xiwi -t" | |
alias xw="xiwi -w" | |
alias emprod="ember build --environment=production" | |
alias npms="npm --save" |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// Creating a new object and saving it | |
temp1.store.createRecord('someModel', {attribute1: 'data', attribute2: 'data'}).save() | |
// Loading data from the server | |
temp1.store.query('someModel', {someParameter: true}) | |
temp1.store.findAll('someModel') |
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
// list availible actions | |
tempObject._actions | |
tempComponent.send('some action') | |
tempController.send('some action') | |
tempRoute.send('some action') |
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
tempSession.set('isAuthenticated', true) | |
tempSession.set('user', tempUserModel) |
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
// redirect to any route | |
tempRoute.transitionTo('someOtherRoute', someParam) | |
// get a JSON object of any model | |
tempModel.toJSON() | |
// trigger events on objects | |
tempObject.trigger('someEvent', 'someParam'); | |
// reload model | |
tempModel.reload() | |
// refresh Route | |
tempRoute.refresh() |
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.Component.extend({ | |
previousMessage: computed('index', function(){ | |
return this.get('messages').objectAt(this.get('index') - 1) | |
}), | |
isDoublePost: computed('previousMessage.content', 'model.content', function(){ | |
console.log(this.get('messages')); |
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', | |
sayHello(){ | |
alert('hello'); | |
}, | |
actions: { |
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', | |
forms: [{ | |
title: 'one', | |
content: '' | |
}, | |
{ | |
title: 'two', |
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, on} = Ember; | |
const getFunctionName = function (fun) { | |
var ret = fun.toString(); | |
ret = ret.substr('function '.length); | |
ret = ret.substr(0, ret.indexOf('(')); | |
return ret; | |
}; |
OlderNewer