Skip to content

Instantly share code, notes, and snippets.

Thomas Chen foxnewsnetwork

Block or report user

Report or block foxnewsnetwork

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View browse.collection.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
queryParams: [{
ctrl: {
type: 'string'
}
}]
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@foxnewsnetwork
foxnewsnetwork / browse.collection.index.template.hbs
Created May 8, 2019
Alternative-Proposal-to-TTI-Measurement
View browse.collection.index.template.hbs
<h2>
browse/collection/index/template.hbs
</h2>
{{outlet}}
@foxnewsnetwork
foxnewsnetwork / controllers.application.js
Created May 1, 2019
Testing-Redirect-Duration-Blank-Ember
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
redirectDuration: Ember.computed("redirectBefore", "transitionStart", {
get() {
return this.get('transitionStart') - this.get('redirectBefore')
}
})
View controllers.application.js
import Ember from 'ember';
function* range(start=0, end=5, step=1) {
for (let i = start; i < end; i += step) {
yield i;
}
}
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
View controllers.application.js
import Ember from 'ember';
import MixerGames from '../data/mixer-games';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
MixerGames,
start: 0,
perPage: 5,
lastPage: Ember.computed("perPage", {
get() {
@foxnewsnetwork
foxnewsnetwork / controllers.application.js
Last active Oct 24, 2018
RSVP rejection window error
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember RSVP rejection demo',
actions: {
die() {
Ember.RSVP.reject("blah blah")
},
swallow() {
@foxnewsnetwork
foxnewsnetwork / controllers.application.js
Created Oct 19, 2018
Ember Error Routing Experiments
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@foxnewsnetwork
foxnewsnetwork / adventures-in-reasonml-js-api-typing.md
Last active Sep 12, 2018
ReasonML JavaScript API Bindings for Union Types
View adventures-in-reasonml-js-api-typing.md

Problem Background

Recently, I've been trying to experiment with using ReasonML in production, however, this generally involves writing bindings to existing libraries... and unfortunately, some of these libraries expose extremely difficult to type interfaces; consider trying to wrap the following getUserInfo function (written in typescript for illustration purposes):

type xInfo = {
    info: string,
    message: string
};
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
You can’t perform that action at this time.