Skip to content

Instantly share code, notes, and snippets.

View chriskrycho's full-sized avatar
⚒️
Building the internal developer platform at Vanta

Chris Krycho chriskrycho

⚒️
Building the internal developer platform at Vanta
View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
someInput: '',
anotherThing: '',
count: 1,
doFoo() {
import Ember from 'ember';
const { Component, RSVP } = Ember;
export default Component.extend({
actions: {
doFoo(bar) {
return RSVP.resolve(bar).finally(() => {
console.log(`did foo with bar ${bar} in A`);
});
import Ember from 'ember';
const { computed, Controller, get, isNone, set } = Ember;
const describe = (value) =>
isNone(value)
? '`undefined` or `null`'
: value === ''
? '<empty string>'
: value;
@chriskrycho
chriskrycho / components.ddau-it.js
Last active February 8, 2017 16:53
New Twiddle
import Ember from 'ember';
const { computed, get, set } = Ember;
export default Ember.Component.extend({
toChange: undefined,
saved: undefined,
model: undefined,

Not yet implemented

  • #1199: simd-infrastructure well It is being rethout so the implementation will be written before stabilize, possibly with a new rfc.
  • #1214: projections-lifetimes-and-wf
  • #1331: grammar-is-canonical
  • #1358: repr-align
  • #1398: kinds-of-allocators
  • #1432: replace-slice
  • #1566: proc-macros
  • #1576: macros-literal-matcher
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
foo: undefined,
bar: null,
quux: ['yay', 'hey'],
baz: 'string',
});
@chriskrycho
chriskrycho / rfc_documentation_status.md
Last active January 21, 2018 01:50
Status (as best it is known) of RFCs not yet documented or tracked in https://github.com/rust-lang-nursery/reference/issues/9

With full credit where it is due: to @EH2406, who put the original together (here). Note that I'm doing a quick pass and confirming each of these as I get to them.

Need documentation - * means this is (should be) in the expressions chapter rewrite

  • #0241: deref-conversions 8.3.2 is missing one (arguably)
  • #0940: hyphens-considered-harmful partially in 6.1.2.1, but it links to the RFC
  • #0953: op-assign, the reference ignores this. (std documentation exists though) *

Stabilized; not reviewed

@chriskrycho
chriskrycho / components.user-message.js
Last active June 16, 2017 20:04
messages-and-errors
import Ember from 'ember';
const { computed, Component, get, run } = Ember;
export default Component.extend({
role: 'alert',
message: null, // passed in
classNameBindings: ['messageTypeClass'],
messageTypeClass: computed('message.type', function (): string {
export namespace Foo {
export const bar: boolean;
export const quux: (a: boolean) => string;
}
export default Foo;
export const baz: string;
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this.set('foo', 'this is more than 10');
}
});