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
| from typing import Union, TypeVar, _type_check, TypingMeta | |
| import builtins | |
| class MyTypingMeta(type): | |
| def __or__(self, tpe): | |
| return Union[self, tpe] | |
| class MyTypeVar(TypeVar, metaclass=TypingMeta, _root=True): | |
| def __pos__(self): | |
| self.__covariant__ = True |
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 { | |
| Component, NgModule, TemplateRef, | |
| Directive, Input, ViewContainerRef, | |
| Compiler, OnChanges, ComponentFactory | |
| } from '@angular/core' | |
| import { CommonModule } from '@angular/common' | |
| @Component({ | |
| template: ` |
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
| <template> | |
| <p> | |
| <haha> | |
| <v-template inline-template> | |
| <span>{{$ctx.name}}说: 闷声发大财 +{{$ctx.i}}s<br/></span> | |
| </v-template> | |
| </haha> | |
| </p> | |
| </template> |
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
| " Vim syntax file | |
| " Language: Vue.js | |
| " Maintainer: Eduardo San Martin Morote | |
| if exists("b:current_syntax") | |
| finish | |
| endif | |
| if !exists("s:syntaxes") | |
| " Search available syntax files. |
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
| "I borrowed this crazy code from vim-tomorrow-theme colorschemes | |
| " Returns an approximate grey index for the given grey level | |
| fun! s:grey_number(x) | |
| if &t_Co == 88 | |
| if a:x < 23 | |
| return 0 | |
| elseif a:x < 69 | |
| return 1 | |
| elseif a:x < 103 |
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
| h('div', {class: 'el-autocomplete', directive: ['clickoutside']}, [ | |
| h('el-input', { props: { | |
| value: this.value, | |
| disabled: this.disabled, | |
| placeholder: this.placeholder, | |
| name: this.name, | |
| size: this.size, | |
| }, on: { | |
| change: this.handleChange.bind(this), | |
| focus: this.handleFocus.bind(this), |
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
| export type HTML = { | |
| div: IfTag<HTML, 'div'> | |
| p: IfTag<HTML, 'p'> | |
| ul: UL<HTML> | |
| ol: OL<HTML> | |
| img: () => HTML | |
| } | |
| export type Comp<Parent, End extends string> = { | |
| props(prop: {[k: string]: any}): Comp<Parent, End> |
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
| {"jsonrpc":"2.0","id":2,"result":{"isIncomplete":false,"items":[{"label":"aria-activedescendant","kind":12,"textEdit":{"range":{"start":{"line":3,"character":13},"end":{"line":3,"character":14}},"newText":"aria-activedescendant=\"$1\""},"insertTextFormat":2},{"label":"aria-atomic","kind":12,"textEdit":{"range":{"start":{"line":3,"character":13},"end":{"line":3,"character":14}},"newText":"aria-atomic=\"$1\""},"insertTextFormat":2},{"label":"aria-autocomplete","kind":12,"textEdit":{"range":{"start":{"line":3,"character":13},"end":{"line":3,"character":14}},"newText":"aria-autocomplete=\"$1\""},"insertTextFormat":2},{"label":"aria-busy","kind":12,"textEdit":{"range":{"start":{"line":3,"character":13},"end":{"line":3,"character":14}},"newText":"aria-busy=\"$1\""},"insertTextFormat":2},{"label":"aria-checked","kind":12,"textEdit":{"range":{"start":{"line":3,"character":13},"end":{"line":3,"character":14}},"newText":"aria-checked=\"$1\""},"insertTextFormat":2},{"label":"aria-colcount","kind":12,"textEdit":{"range": |
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
| Error processing request. Cannot set property 'typeParameters' of undefined | |
| TypeError: Cannot set property 'typeParameters' of undefined | |
| at assignContextualParameterTypes (/project/node_modules/typescript/lib/tsserver.js:36049:38) | |
| at checkFunctionExpressionOrObjectLiteralMethod (/project/node_modules/typescript/lib/tsserver.js:36336:29) | |
| at checkObjectLiteralMethod (/project/node_modules/typescript/lib/tsserver.js:37103:38) | |
| at checkObjectLiteral (/project/node_modules/typescript/lib/tsserver.js:33798:32) | |
| at checkExpressionWorker (/project/node_modules/typescript/lib/tsserver.js:37192:28) | |
| at checkExpression (/project/node_modules/typescript/lib/tsserver.js:37144:42) | |
| at checkExpressionForMutableLocation (/project/node_modules/typescript/lib/tsserver.js:37088:24) | |
| at checkPropertyAssignment (/project/node_modules/typescript/lib/tsserver.js:37096:20) |
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
| /** | |
| * This gist demonstrates how powerful TypeScript's new tuple type is. | |
| * Say, we want to write a function that receive multiple arguments, and return a tuple of arguments' types. | |
| * For example, `getTypes(1, true, 'str')` return a tuple `['number', 'boolean', 'string']`. | |
| * We can do that in **type safe** way in TypeScript now! And actually we can do the computation at compile time! | |
| * This is so like dependent type in TypeScript! | |
| * Reference: https://github.com/Microsoft/TypeScript/pull/24897 | |
| */ | |