I hereby claim:
- I am tansongyang on github.
- I am tansongyang (https://keybase.io/tansongyang) on keybase.
- I have a public key ASD27yKRSxfJSerZr5ww8DNMMW-TsZdGJR3zCfjrayjFqwo
To claim this, I am signing this object:
| import Component from '@glimmer/component'; | |
| import { inject as service } from '@ember/service'; | |
| import { action } from '@ember/object'; | |
| export default class extends Component { | |
| @service counter; | |
| get count() { | |
| return this.counter.count; | |
| } |
| function toCents(value: number) { | |
| return Math.round(value * 100); | |
| } | |
| function fromCents(value: number) { | |
| return +(value / 100).toFixed(2); | |
| } | |
| class Money { | |
| private cents: number; |
I hereby claim:
To claim this, I am signing this object:
| import BracketHighlighter.bh_plugin as bh_plugin | |
| import sublime | |
| class ViMoveToBrackets(bh_plugin.BracketPluginCommand): | |
| """ | |
| Move to Bracket plugin for Vintage. | |
| Based on [Select Bracket plugin](https://github.com/facelessuser/BracketHighlighter/blob/st3-2.23.3/bh_modules/bracketselect.py). | |
| """ |
| // http://stackoverflow.com/questions/38090023/whats-the-lodash-fp-equivalent-of-ramdas-evolve-function/38425764#38425764 | |
| const mapValuesWithKey = _.mapValues.convert({cap: false}); | |
| function evolve(transformations) { | |
| return item => | |
| mapValuesWithKey((value, key) => { | |
| const transformation = _.getOr(_.identity)(key)(transformations); | |
| const type = typeof transformation; | |
| return type === 'function' ? |
| // Based on this gist: https://gist.github.com/ChrisJefferson/cb8db2a4c67a9506c56c | |
| // JS Bin: https://jsbin.com/cefopi/edit?js,console | |
| const cartesianProduct = (...rest) => | |
| _.reduce((a, b) => | |
| _.flatMap(x => | |
| _.map(y => | |
| x.concat([y]) | |
| )(b) | |
| )(a) | |
| )([[]])(rest); |