Skip to content

Instantly share code, notes, and snippets.

View jamesarosen's full-sized avatar

James A Rosen jamesarosen

View GitHub Profile
@jamesarosen
jamesarosen / emberjs2018.md
Last active May 31, 2018 19:59
Ember 2018 Roadmap

Background

I have been working with Ember since the SproutCore days. I have watched a passionate, dedicated team spend the last 7 years continually improving the framweork and its ecosystem. Along the way, many things have changed (almost always for the better), but some things have remained constant.

Many of the things I say below have been said by others before. I particularly recommend reading Matt McManus's Improve the interoperability of the community and the framework and Chris Garrett's Ember as a Component-Service Framework.

@jamesarosen
jamesarosen / controllers.application.js
Last active May 17, 2018 19:45
query-params-debugging
import Ember from 'ember';
console.clear()
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
clearLog() {
this.get('log').clear()
},
foo: undefined,
@jamesarosen
jamesarosen / components.fui-truncate.js
Last active February 16, 2018 20:05
inner-truncate
import Ember from 'ember'
import hbs from 'htmlbars-inline-precompile'
export default Ember.Component.extend({
suffixLength: 4,
text: null,
prefix: Ember.computed('suffixLength', 'text', function() {
const suffixLength = this.get('suffixLength')
const text = this.get('text') || ''
@jamesarosen
jamesarosen / components.click-me.js
Created February 8, 2018 18:19
action-bubbling
import Ember from 'ember'
import hbs from 'htmlbars-inline-precompile'
export default Ember.Component.extend({
// The key is the argument to `sendAction`, below.
// The value is the name of the action that bubbles up. In this case,
// it matches something in controller:application.
clickMe: 'clickMeWasClicked',
layout: hbs`
@jamesarosen
jamesarosen / has-zero-or-one.md
Last active December 21, 2019 19:33
Ember-Data: hasZeroOrOne

Background

In our app, we have a number of different has-zero-or-one relationships where the foreign object may or may not exist. For example, a Customer may or may not have a CreditCard on file, but it won't have more than one.

We started with something like

// app/models/customer.js
export default DS.Model.extend({
@jamesarosen
jamesarosen / grill-rub.md
Last active June 7, 2017 03:53
James' Grill Rub

Sprinkle on salmon, chicken wings, roast root vegetables, popcorn, or whatever.

It's salt-free. I prefer to salt each dish individually.

The quantities below make just under 1/2 C. I use this most times I cook. If you're worried about not using it all within about 6 months, halve the recipe.

@jamesarosen
jamesarosen / healthcare.md
Last active May 13, 2017 15:56
Rambling thoughts on healthcare in America

Background

My friend and I were debating healthcare on Facebook. He recommended I watch this video by Stefan Molyneaux, which I did. My response was too long for Facebook and I don't have a better spot to put it, so I'm posting it here.

Summary

  • Government is a useful tool against abuses by those in power (including corporations, other parts of the government, and terrorists).
  • I absolutely agree with Molyneaux that we need to unbundle healthcare from employment. This is an unfair legacy system that gives employers too much power, employees too little flexibility, and spreads the benfit too thinly.
  • I like Molyneaux's "predictability vs cost" quandrant setup. This is a useful tool in evaluating policy options.
@jamesarosen
jamesarosen / keybase.md
Created February 1, 2017 00:30
Keybase Verification

Keybase proof

I hereby claim:

  • I am jamesarosen on github.
  • I am jamesarosen (https://keybase.io/jamesarosen) on keybase.
  • I have a public key ASCZBlGPvvF0orADOvinQs3X0aKHdjT3Jl-j9CdJdpikCwo

To claim this, I am signing this object:

@jamesarosen
jamesarosen / controllers.application.js
Last active December 19, 2016 20:05
SerializeQueryParams
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
queryParams: [ 'q' ],
q: 'defaultValue'
});
@jamesarosen
jamesarosen / controllers.application.js
Created December 14, 2016 00:12
tether-dialog-constraints
import Ember from 'ember';
export default Ember.Controller.extend();