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
// MIT licensed (© 2024) | |
// https://opensource.org/license/mit | |
// | |
// Source: https://gist.github.com/anthonyjoeseph/102c0e3ea8496fe111029a8b8a95cc3a | |
// motivation: | |
// `drizzle-kit generate` has a default behavior that causes headaches | |
// it will randomly generate names for migration files | |
// e.g. "0012_swift_rhino.sql" | |
// this means that migration conflicts across branches are easy to miss |
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
// MIT licensed (© 2024) | |
// https://opensource.org/license/mit | |
// | |
// Source: https://gist.github.com/anthonyjoeseph/6b99beb34d494acd1dfc83a192ed9388/edit | |
// Original (with bug): https://gist.github.com/gburtini/7e34842c567dd80ee834de74e7b79edd | |
import fs from "fs"; | |
import config from "../../drizzle.config"; | |
import path from "path"; |
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 { | |
AminoConverters, | |
AminoMsgUnjail, | |
AminoTypes, | |
SigningStargateClient, | |
StargateClient, | |
createDefaultAminoConverters, | |
defaultRegistryTypes, | |
makeMultisignedTxBytes, | |
} from "@cosmjs/stargate"; |
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 path from "path"; | |
import fs from "fs"; | |
import { coins, pubkeyToAddress } from "@cosmjs/amino"; | |
import { fromHex, toBase64, toHex } from "@cosmjs/encoding"; | |
import { StargateClient } from "@cosmjs/stargate"; | |
import { encodePubkey, makeSignBytes } from "@cosmjs/proto-signing"; | |
import { EncodeObject, Registry, makeAuthInfoBytes, makeSignDoc } from "@cosmjs/proto-signing"; | |
import { sha256 } from "@cosmjs/crypto"; | |
import { FireblocksSDK, TransactionOperation, TransactionStatus } from "fireblocks-sdk"; | |
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx"; |
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
{ | |
"name": "Tests against TS v3.9", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"dependencies": { | |
"typescript": "^3.9.2" | |
} | |
} |
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
/** | |
* @since 2.11.0 | |
*/ | |
import { URIS3, Kind3, URIS2, Kind2, URIS, Kind, URIS4, Kind4, HKT } from './HKT' | |
import * as R from './ReadonlyRecord' | |
import { Option, fromNullable, fromPredicate, some, Applicative as OptionApplicative } from './Option' | |
import { Either, right, left } from './Either' | |
import { Ord } from './Ord' | |
import { Ord as StringOrd } from './string' | |
import { Apply4, Apply3, Apply3C, Apply2, Apply2C, Apply1, Apply } from './Apply' |
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 { sum } from 'fp-ts-std/Array'; | |
import * as A from 'fp-ts/Array'; | |
import { pipe } from 'fp-ts/function'; | |
import * as O from 'fp-ts/Option'; | |
import * as T from 'fp-ts/Tree'; | |
import React from 'react'; | |
// npm package name: fp-ts-tree-contrib ? | |
export const isLeaf = <A,>(tree: T.Tree<A>): boolean => tree.forest.length === 0 |
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 mapAll = <A, B>(vals: { | |
[K in NonNullable<keyof A>]: (val: A[K]) => B | |
}) => (a: A): { | |
[K in NonNullable<keyof A>]: B | |
} => { | |
const keys = Object.keys(a) as (NonNullable<keyof A> & string)[] | |
const mapped = fromFoldableMap( | |
S.getLastSemigroup<B>(), RA.readonlyArray | |
)( | |
keys, (key) => [key, vals[key](a[key])] |
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 React from 'react' | |
import * as A from 'fp-ts/Array'; | |
const Table2 = <A,>({ | |
data, order, headerTitles, rowRenderer | |
}: { | |
data: A[] | |
order: NonNullable<keyof A>[] | |
headerTitles: { | |
[K in NonNullable<keyof A>]: string |
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 { flow, pipe } from 'fp-ts/function'; | |
import * as E from 'fp-ts/Either' | |
import * as r from 'rxjs' | |
import * as ro from 'rxjs/operators' | |
import * as OB from 'fp-ts-rxjs/lib/Observable' | |
export const tryCatch = <E, A>( | |
onErr: (e: unknown) => E | |
): r.OperatorFunction<A, E.Either<E, A>> => flow( | |
OB.map(E.right), |
NewerOlder