Skip to content

Instantly share code, notes, and snippets.

import Component from '@glimmer/component';
export default class extends Component {
}
@wycats
wycats / 1-js.js
Created July 30, 2020 19:25
alternative observer design
// observed popover is interested in changes to `width` and `height` relative to the
// page's origin, and normalized by rounding them to the nearest integer.
let observedPopover = new RectObserver(
popoverElement,
{
width: Math.round,
height: Math.round
},
{
relativeTo: 'origin' // not viewport
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
value: 'Hello world',
inputted(e) {
Ember.set(this, 'value', e.target.value);
}
});
@wycats
wycats / js.ts
Last active November 29, 2018 18:47
// default tagName is 'div'
// The problem
function createElement(tagName: string): Element {
// very broken
return document.createElement(tagName || 'div');
}
// you might want to use defaults
import Ember from 'ember';
export default Ember.Component.extend({
});
import { unknown } from 'ts-std';
import { ErrorMessage } from "monad-test";
export type ErrorPath = ReadonlyArray<string>;
export interface ErrorMessage {
key: string;
args: unknown;
}
import FirebaseAdapter from 'emberfire/adapters/firebase';
export default FirebaseAdapter.extend({
});

The Ember Creed

  1. Optimize for programmer happiness
  2. Convention over configuration
  3. The menu is omakase
  4. No one paradigm
  5. Exalt beautiful code
  6. Provide sharp knives
  7. Value integrated systems
  8. Stability without Stagnation
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@wycats
wycats / freddie7.md
Last active April 8, 2018 02:17
A Response to "The Birthering of the Democrats"

Response to The Birthering of the Democrats

Let us accept from the outset that partisan Democrats and I will never agree on the substance of the particular claims they have made about the election. Let’s simply try to find common ground on what they’re alleging. Conventional post-election debate among Democrats has involved…

Freddie claims that "conventional post-election debate among Democrats" is made up of a number of characteristics. I don't think the debate has been nearly as homogenous as he implies, and the bullets are full of misleading hyperbole that further amps up the emotion of the piece.