This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Next<T extends number> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64][T]; | |
export type Prev<T extends number> = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62][T]; | |
type GetLast<original extends any[]> = original extends { length: infer L } ? ( | |
L extends number ? original[Prev<L>] : never | |
) : never | |
type Stuff = [number, boolean, string] | |
type OtherStuff = [string, number, object, boolean] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
reduce, | |
complement, | |
isNil | |
} from 'ramda'; | |
const isDefined = complement(isNil); | |
const Maybe = do { | |
const __maybe = Symbol('Maybe'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// So this is fking incredible. Its actually possible to | |
// do totally immutable state inside a generator. | |
// No mutations. No 'let's. No shame! | |
function* range(start, end, step = 1, current = start) { | |
yield current; | |
if (current < end) yield* range(start, end, step, current + step); | |
} | |
// In the name of the Turing, and of the Crockford, and of the holy Atwood, Amen. | |
console.log(...range(5, 15)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jshint expr:true */ | |
import { expect } from 'chai'; | |
import { | |
describe, | |
it | |
} from 'mocha'; | |
import { | |
convertTimeTo12 | |
} from 'digital-court-results/helpers/time-format'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
model: [ | |
{name: 'billy', age: 20}, | |
{name: 'george', age: 30}, | |
{name: 'william', age: 50} | |
] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const PositionalParams = {positionalParams: ["thing"]}; | |
export default Ember.Component.extend(PositionalParams, { | |
thing: "meow" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
timeline: DS.belongsTo("timeline"), | |
type: DS.attr("string") | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`import Ember from 'ember'` | |
IndexController = Ember.ObjectController.extend | |
needs: ['application'] | |
actions: | |
hasProjects: (-> | |
@get('model.length') > 0 | |
).property('model.length') | |
`export default IndexController` |