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
Phoenix.set({ | |
openAtLogin: true, | |
}) | |
Key.on('return', ['option'], () => { | |
createTerminal() | |
}) | |
Key.on('y', ['option'], () => { | |
Modal.build({ |
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
const UNSAFE_CHARS_REGEXP = /[<>\/\u2028\u2029]/g | |
const ESCAPED_CHARS = { | |
'<' : '\\u003C', | |
'>' : '\\u003E', | |
'/' : '\\u002F', | |
'\u2028': '\\u2028', | |
'\u2029': '\\u2029' | |
} | |
function escapeUnsafeChars(unsafeChar) { | |
return ESCAPED_CHARS[unsafeChar] |
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
class Maybe<A> { | |
[Generic.repr]: Generic<MaybeRepr, A> | |
} | |
interface MaybeRepr extends Repr { | |
type: Maybe<this[1]> | |
} | |
type test1 = Of<MaybeRepr, string> // Maybe<string> | |
class Result<T, E> { | |
[Generic.repr]: Generic<ResultRepr, T, E> |
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
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> | |
type DiscriminateUnion<Union, TagKey extends keyof Union, TagValue extends Union[TagKey]> = | |
Union extends Record<TagKey, TagValue> ? Union : never | |
type MatchingFunc<A extends { kind: string }, K extends A['kind'], U> = (a: Omit<DiscriminateUnion<A, 'kind', K>, 'kind'>) => U | |
function match<A extends { kind: string }>(discriminant: A) { | |
return <U>(obj: |
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
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> | |
/* Source: https://github.com/Microsoft/TypeScript/pull/21316#issuecomment-364982638 */ | |
type DiscriminateUnion<Union, TagKey extends keyof Union, TagValue extends Union[TagKey]> = | |
Union extends Record<TagKey, TagValue> ? Union : never | |
type MatchingFunc<A extends { kind: string }, K extends A['kind'], U> = (a: Omit<DiscriminateUnion<A, 'kind', K>, 'kind'>) => U | |
function match<A extends { kind: string }>(discriminant: A) { |
Error: 'tls: oversized record received with length 20527'
Trying to reach: 'https://172.17.0.3:9090/'
Remove the https:
from the URL path. The link will become:
http://localhost:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard:/proxy/
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
// Trying to simulate do-notation in TypeScript using async/await | |
// Trying to convert https://codewithstyle.info/advanced-functional-programming-typescript-monads-generators/ | |
// to use async/await. Generators work but aren't type safe because of https://github.com/Microsoft/TypeScript/issues/2983 | |
interface MyPromise<A> { | |
then<B>(fn: (a: A) => Option<B>): MyPromise<B> | |
} | |
export class Option<A> implements MyPromise<A> { |