Skip to content

Instantly share code, notes, and snippets.

import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
export default class ApplicationController extends Controller {
@tracked isBusy = false
@action
toggleBusy() {
this.isBusy = !this.isBusy;
@amk221
amk221 / airplay2.md
Last active June 4, 2021 13:43
List of streamers with Shairport Sync

Purpose of this list is to identify brands that sell Network Streamers with Airplay 1 only. (At the time of writing Shairport Sync only supports AP1).

Definitly not Shairport Sync

  • Arcam
  • Bang & Olufsen
  • Belkin
  • Bluesound
  • Cambridge Audio
  • Cyrus Audio
@amk221
amk221 / placeholder.css
Last active May 3, 2024 13:11
Prosemirror placeholder plugin approach
.ProseMirror[data-placeholder]::before {
color: global.$placeholder-colour;
position: absolute;
content: attr(data-placeholder);
pointer-events: none;
}
import Controller from '@ember/controller';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
@action
submit(e) {
e.preventDefault(); // Don't actually submit the form
console.log('submit', e)
}
import Controller from '@ember/controller';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
@action
handleKeyDown(e) {
console.log('down', e)
}
@action
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { A as emberA } from '@ember/array';
import { dependentKeyCompat } from '@ember/object/compat';
export default class ApplicationController extends Controller {
items = emberA(['Existing item'])
get computedItems() {
return [...this.items, 'Item from computed property'];
@amk221
amk221 / adapters.email\.js
Last active August 4, 2022 14:29
Relationships .get
import RESTAdapter from 'ember-data/adapters/rest';
export default class EmailAdapter extends RESTAdapter {
}
@amk221
amk221 / controllers.application\.js
Last active December 10, 2020 01:38
Chrome a11y issue
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
triggerLabel = 'Two';
}
@amk221
amk221 / router\.js
Last active December 9, 2020 09:16
Select Box a11y demo
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
const Router = EmberRouter.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('example1')
@amk221
amk221 / adapters.person\.js
Last active December 7, 2020 10:43
data store
import RESTAdapter from 'ember-data/adapters/rest';
export default class PersonAdapter extends RESTAdapter {
// store.find will hand off work to an appropriate apapter
// depending on the model
findRecord() {
console.log('person being found by adapter...');
// The default behaviur of findRecord is to