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 interface Tab<TProps = unknown> { | |
| title: string; | |
| content: TProps extends React.HTMLAttributes<TProps> | |
| ? React.ReactNode | |
| : React.ReactElement<TProps & { viewMode: ViewMode }>; | |
| popout?: boolean; | |
| } |
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
| type PartialDeep<T> = { | |
| [ P in keyof T ]?: PartialDeep<T[ P ]>; | |
| } | |
| type PartialRestoreArrays<K> = { | |
| [ P in keyof K ]?: K[ P ]; | |
| } |
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
| 'use strict'; | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| /* const input = '#1 @ 1,3: 4x4\n#2 @ 3,1: 4x4\n#3 @ 5,5: 2x2\n'; */ | |
| const input = fs.readFileSync(path.join(__dirname, 'day3.txt')).toString(); | |
| const lines = input.split('\n').slice(0, -1); |
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 DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]> }; |
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
| plugins=( | |
| zsh-nvm | |
| git | |
| iterm2 | |
| colored-man-pages | |
| yarn | |
| vscode | |
| frontend-search | |
| zsh-autosuggestions | |
| zsh-history-substring-search |
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 React from 'react'; | |
| import { range } from 'lodash'; | |
| import { Point } from '../../model/point'; | |
| import { degreesToRadians } from '../../util/trigonometry'; | |
| export enum HexagonType { | |
| flat = 'flat', | |
| pointy = 'pointy' | |
| } |
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 { AutoIncrement, Column, CreatedAt, Model, PrimaryKey, Table, UpdatedAt } from 'sequelize-typescript'; | |
| import { Field, ObjectType, ID, InterfaceType } from 'type-graphql'; | |
| @ObjectType() | |
| @Table({ tableName: 'users', timestamps: true, freezeTableName: false }) | |
| export class User extends Model<User> { | |
| @Field((type) => ID) | |
| @PrimaryKey | |
| @AutoIncrement | |
| @Column |
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 MapMapStateToProps<T, K extends keyof T, S> = MapStateToProps<Pick<T, K>, Exclude<T, K>, S>; | |
| // usage | |
| const mapStateToProps: MapMapStateToProps<MyComponentProps, 'someProp' | 'andAnother', State> = state => ({ | |
| someProp: selector(state), | |
| andAnother: anotherSelector(state) | |
| }); |
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 declare type MapMapStateToProps<T, K extends keyof T, S> = MapStateToProps<Pick<T, K>, Exclude<T, K>, S>; | |
| const mapStateToProps: MapMapStateToProps<MyComponentProps, 'someProp' | 'andAnother|, State> = state => ({ | |
| someProp: selector(state), | |
| andAnother: anotherSelector(state) | |
| }); |
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 declare type MapMapStateToProps<T, K extends keyof T, S> = MapStateToProps<Pick<T, K>, Exclude<T, K>, S>; | |
| const mapStateToProps: MapMapStateToProps<MyComponentProps, 'someProp' | 'andAnother|, State> = state => ({ | |
| someProp: selector(state), | |
| andAnother: anotherSelector(state) | |
| }); |