Skip to content

Instantly share code, notes, and snippets.

Cream Cheese Pumpkin Roll

Ingredients

  • 3 eggs
  • 2/3 cup canned pumpkin
  • 1 cup sugar
  • 1 teaspoon of baking soda
  • 1/2 teaspoon ground cinnamon
  • 3/4 cup of flour
@machty
machty / new-router-examples.md
Last active April 16, 2020 22:03
How to do cool stuff with the new Router API
@machty
machty / e-c-observable-integration.md
Created November 26, 2016 21:54
ember-concurrency observable integration thoughts

Observable integration

Lots of FPR libraries use Observables as their central async/concurrency primitive, so it'd be nice if ember-concurrency could integrate with these libraries.

Before delving into how this might be possible, here's a quick compare/contrast between e-c Tasks and Observables:

  • Modeling Streams
    • both e-c tasks and observables can async streams of zero or more values followed by an optional success/error termination
      • observables emit values using onNext(), onCompleted(), and onError()
  • tasks emit values using emit(), and returning a value from a generator fn is an implicit emit(), and throwing an error is an implicit onError
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
get foo() {
return "i was returned from the getter foo";
}
});
@machty
machty / router-js-refactor-architecture.md
Last active July 31, 2019 18:39
Overview of the architecture and approach to the router.js refactor

router.js Architecture

Let this serve as a guide for anyone who'd like to dig into router.js's internals, understand what's going on, and hopefully contribute!

Scope of router.js (et al)

router.js is most popularly known as the routing microlib used by the Ember.js Router, though other folk have been known to use it beyond Ember, including some Angular folk who weren't satisfied with

import Ember from 'ember';
import { task, timeout, waitForProperty } from 'ember-concurrency';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
count: 0,
foo: task(function() {
return {
@machty
machty / document-title-router.js
Created January 14, 2014 05:12
document.title integration in ember
// Extend Ember.Route to add support for sensible
// document.title integration.
Ember.Route.reopen({
// `titleToken` can either be a static string or a function
// that accepts a model object and returns a string (or array
// of strings if there are multiple tokens).
titleToken: null,
@machty
machty / controllers.application.js
Last active December 17, 2018 19:37
New Twiddle
import Ember from 'ember';
let guid = () => (Math.random().toString(36) + '00000000000000000').slice(2, 14)
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
vol: Ember.computed(function() {
return guid();
}).volatile(),
actions: {
@machty
machty / controllers.application.js
Last active October 28, 2018 09:36
New Twiddle
import Ember from 'ember';
import { lifespan, subscription } from "../subscription";
import { bind } from '@ember/runloop';
import { task, timeout } from 'ember-concurrency';
export default Ember.Controller.extend({
chatRooms:[ "EmberChat", "ReactChat", "VueChat", "AngularChat"],
chatRoom: null,
// chatRoomName: null,