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 Component from '@ember/component'; | |
import { readOnly } from '@ember/object'; | |
export default Component.extend({ | |
user: readOnly('model') | |
}); |
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: 'get/set Demo', | |
model: null, | |
valueOne: 'Hello', | |
valueTwo: Ember.computed('valueOne', function() { | |
return this.get('valueOne') + ' from 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: { or } | |
} = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
isSunny: false, |
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'; | |
import DS from 'ember-data'; | |
export default DS.Transform.extend({ | |
deserialize: function(serialized) { | |
return Ember.isNone(serialized) ? {} : serialized; | |
}, | |
serialize: function(deserialized) { | |
return Ember.isNone(deserialized) ? {} : deserialized; | |
} |
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, | |
String: { htmlSafe }, | |
run: { scheduleOnce }, | |
RSVP: { Promise }, | |
} = Ember; | |
export default Ember.Component.extend({ | |
classNames: ['preload-img'], |
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'; | |
import PSOptionsComponent from 'ember-power-select/components/power-select/options'; | |
const { | |
$, | |
assert, | |
get, | |
} = Ember; |
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'; | |
import { pipeline, step, CANCEL } from 'ember-pipeline'; | |
import timeout from '../utils/timeout'; | |
export default Ember.Controller.extend({ | |
result: 'Nothing run yet', | |
value: 10, | |
fizzBuzz: Ember.computed(function() { | |
return pipeline(this, [ |
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'; | |
import { task, timeout } from 'ember-concurrency'; | |
const { | |
Component, | |
assert, | |
get, | |
set, | |
} = Ember; |
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/bash | |
#!/usr/local/bin/python | |
""" | |
To use this script, you must be in the root directory of a Rails project that | |
is using git. You should also make sure that your directory does not contain any | |
uncommitted changes. Then run: | |
$ python rails_switch_branch.py name_of_another_branch | |
Running the above will do the following: |