This file contains hidden or 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 {Maybe} from './Maybe' | |
describe('Maybe', ()=> { | |
const nothing = Maybe.Nothing | |
const just = Maybe.Just(1) | |
describe('Nothing', ()=> { | |
it('should not be exist', ()=> { | |
expect(nothing.exists).to.equal(false) | |
}) |
This file contains hidden or 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 * as ReactDOM from 'react-dom' | |
import * as React from 'react' | |
export class Component extends React.Component { | |
render() { | |
return <div style={{cursor: 'pointer', userSelect: 'none'}} | |
onClick={()=> this.clicked()}> | |
This text is clicked {this.state.count} times. | |
</div> | |
} |
This file contains hidden or 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
class NodeTree { | |
insert(node: Node): void { | |
if (this.has(node)) { | |
throw new UnexpectedStructure() // TODO | |
} | |
const getParent = (): Node | undefined => { | |
const filter: TravelFilter = candidate => candidate.contains(node) ? Travel.ACCEPT : Travel.REJECT | |
const ancestorPaths = this.DFS(document.body, filter) |
This file contains hidden or 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
void main() { | |
final func = Callable((a)=> print(a)); | |
func('a'); | |
} | |
class Callable { | |
Function func; | |
@override | |
noSuchMethod(invocation) { |
This file contains hidden or 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
Path p = Path(); | |
p.addOval(Rect.fromPoints(Offset(0, 0), Offset(100, 100))); | |
final m = p.computeMetrics().first.getTangentForOffset(75 * pi); | |
print(m.position); |
OlderNewer