This file contains 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 scala.io.Source | |
val listOfLines = Source.fromFile("filename.txt").getLines.toList |
This file contains 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 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', | |
actions: { | |
foo(event){ | |
if($(event.target).is("#list")){ | |
alert("Foo"); | |
} | |
This file contains 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 { computed } from '@ember/object'; | |
import Table from 'ember-light-table'; | |
export default Component.extend({ | |
init() { | |
this._super(...arguments); | |
let table = new Table(this.get('columns'), this.get('models'), { enableSync: this.get('enableSync') }); | |
let sortColumn = table.get('allColumns').findBy('valuePath', this.get('sort')); |
This file contains 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 {computed} from '@ember/object'; | |
export default Ember.Controller.extend({ | |
init(){ | |
this._super(...arguments); | |
this.set('placeholder', "type here"); | |
}, | |
appName: 'Ember Twiddle', | |
passwordsMatch: computed('password', 'passwordConfirm', function(){ | |
return this.get('password') === this.get('passwordConfirm'); |
This file contains 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 { inject } from '@ember/service'; | |
import { computed } from '@ember/object'; | |
export default Ember.Component.extend({ | |
modeService: inject(), | |
renderList: computed('modeService.mode', function(){ | |
let mode = this.get('modeService.mode'); | |
return mode === 'list'; | |
}) |
This file contains 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 Controller from '@ember/controller'; | |
export default Controller.extend({ | |
init(){ | |
this._super(...arguments); | |
this.set('images', [ | |
"https://avatars0.githubusercontent.com/u/4096934?s=460&v=4" | |
]); | |
} | |
}); |
This file contains 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'; | |
export default Component.extend({ | |
}); |
This file contains 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.Component.extend({ | |
init(){ | |
this._super(...arguments); | |
this.name = 'foo'; | |
}, | |
actions: { | |
toggleName(){ | |
this.set('name', this.name === 'foo' ? 'bar' : 'foo') |
This file contains 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 { computed } from '@ember/object'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
init(){ | |
this._super(...arguments); | |
this.first = "Mista"; | |
this.last = "Henry"; | |
this.name = 'Not MistaHenry'; |
OlderNewer