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' | |
}); |
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' | |
}); |
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 hexColor from '../utils/hex-color'; | |
const { | |
Controller, | |
computed | |
} = Ember; | |
export default Controller.extend({ | |
/** |
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 { Component, computed } = Ember; | |
export default Component.extend({ | |
classNames: 'x-input', | |
tagName: 'p', | |
attributeBindings: ['_lowerName:data-field-name'], | |
_lowerName: computed('label', function() { | |
return (this.get('label') || '').dasherize(); |
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' | |
}); |
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.Component.extend({ | |
didInsertElement() { | |
this._super(...arguments); | |
this.get('pr').then(this._handleDataResponse.bind(this)); | |
}, | |
_handleDataResponse(jsonData) { | |
if (this.isDestoyed || this.isDestroying) { | |
return; // too late! |
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
document.write('<canvas id="canvas"></canvas>'); | |
window.navigator.mediaDevices.getUserMedia({ video: "camera" }).then(stream => { | |
capturer = new ImageCapture(stream.getVideoTracks()[0]); | |
capturer.grabFrame().then(bitmap => { | |
let canvas = document.getElementById("canvas"); | |
canvas.height = bitmap.height / bitmap.width * canvas.width; | |
let ctx = canvas.getContext("2d"); | |
ctx.drawImage(bitmap, 0, 0, |
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
outer = -1 | |
IO.puts "BEGIN: outer=#{outer}" | |
[1, 2, 3] | |
|> Enum.each fn i -> | |
IO.puts "BEFORE: i=#{i}, outer=#{outer}" | |
outer = i | |
IO.puts "AFTER: i=#{i}, outer=#{outer}" | |
end | |
IO.puts "END: outer=#{outer}" |
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', | |
init() { | |
this._super(...arguments); | |
this.set('myArray', []); | |
this.set('x', 3); | |
this.set('arraySum1InvocationCount', 0); | |
this.set('arraySum2InvocationCount', 0); |