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
// @ts-check | |
import { fixupPluginRules } from '@eslint/compat'; | |
import pluginCypress from 'eslint-plugin-cypress/flat'; | |
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | |
import reactPlugin from 'eslint-plugin-react'; | |
import reactHookPlugin from 'eslint-plugin-react-hooks'; | |
import simpleImportSort from 'eslint-plugin-simple-import-sort'; | |
import eslintPluginUnicorn from 'eslint-plugin-unicorn'; | |
import tseslint from 'typescript-eslint'; |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
platform=$(uname -ms) | |
if [[ ${OS:-} = Windows_NT ]]; then | |
if [[ $platform != MINGW64* ]]; then | |
powershell -c "irm bun.sh/install.ps1|iex" | |
exit $? | |
fi |
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
function methodDecorator(target, name, descriptor) { | |
const method = descriptor.value; | |
descriptor.value = function (...args) { | |
method.apply(this, args); | |
return this; | |
}; | |
} | |
class Person { | |
isSignedIn = 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
type Records<Keys extends keyof JSX.IntrinsicElements = keyof JSX.IntrinsicElements> = { | |
[P in Keys]: CSSProperties & JSX.IntrinsicElements[P] & { tag: P; }; | |
}[Keys]; | |
const Box: FC<Records> = ({tag, children, ...rest}): JSX.Element => { | |
const {styles, attributes} = splitProps(rest); | |
const Tag = tag as string; | |
return <Tag style={styles} {...attributes}>{children}</Tag> | |
} |
This file has been truncated, but you can view the full file.
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 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 { useLayoutEffect } from 'react'; | |
import { debounce } from 'lodash'; | |
import { GridApi } from 'ag-grid-community'; | |
const events = [ | |
'firstDataRendered', | |
'gridSizeChanged', | |
'modelUpdated', | |
'viewportChanged', | |
]; |
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 { BehaviorSubject, Observable } from 'rxjs'; | |
import { | |
combineLatest, filter, map, scan, tap, | |
} from 'rxjs/operators'; | |
const scanResetPause = ($isBusy: Observable<boolean>) => { | |
return interval(2000).pipe( | |
scan((acc, value) => { | |
if (!isBusy$.getValue()) { | |
return { prevIsBusy: false, value }; |
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
interface WithId { | |
id: string | number; | |
} | |
type Transaction<T extends WithId = WithId> = T[]; | |
export class TransactionalCache<T extends WithId = WithId> { | |
private remove: T[]; | |
private update: T[]; | |
private add: T[]; |
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 {HubConnection} from '@microsoft/signalr'; | |
//payload can be a one off payload or a Subject | |
export const getSignalRStreamRx = (hubConnection: HubConnection, operation: string, payload: any) => new Observable(observer => { | |
const subscription = hubConnection.stream(observer, operation, payload); | |
return { | |
unsubscribe: () => { | |
subscription.unsubscribe(); | |
} |
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
const {Repository, Branch, Enums, Cred} = require('nodegit'); | |
const {version} = require('./package.json'); | |
const branchName = `release-${version}`; | |
const run = async () => { | |
try { | |
const repo = await Repository.open('./'); | |
await repo.checkoutBranch('master'); |
NewerOlder