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 class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
} |
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 '@glimmer/component'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
export default class extends Component { | |
@tracked isOpen = true; | |
@action | |
close() { | |
this.isOpen = false; | |
} |
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 class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
} |
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'; | |
export default Ember.Controller.extend({ | |
routerService: inject('router'), | |
analytics: inject('analytics'), | |
appName: 'Ember Twiddle', | |
}); |
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
// vget: like `get` but ensures the response body matches the schema for an endpoint. e.g. `validated get` | |
this.vget = (path, callback) => { | |
this.get(path, (schema, request) => { | |
request.__validationPath__ = `/${path}`; | |
return Promise.resolve().then(async () => { | |
await ensureSchemaLoaded(request.requestHeaders.Accept); | |
return callback.call(this, schema, request); | |
}); | |
}); | |
}; |
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
const puppeteer = require('puppeteer'); | |
(async () => { | |
const { HEROKU_EMAIL, HEROKU_PASSWORD } = process.env; | |
const browser = await puppeteer.launch({headless: false}) | |
const page = await browser.newPage(); | |
await page.goto('https://dashboard.heroku.com'); | |
// login | |
await page.type('#email', HEROKU_EMAIL); |
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', | |
}); |
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 { task, timeout } from 'ember-concurrency'; | |
const steps = [ | |
{ | |
type: 'static', | |
message: 'i am totally a human!' | |
}, | |
{ |
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'; | |
const { computed } = Ember; | |
export default Ember.Component.extend({ | |
isExpanded: false, | |
maxCollapsed: 5, | |
viewableContent: computed('maxCollapsed', 'content.[]', 'content.length', 'isExpanded', function() { | |
const { content, isExpanded } = this.getProperties('content', 'isExpanded', 'maxCollapsed'); | |
NewerOlder