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
$ cat Cargo.toml | |
[package] | |
name = "rustdepstest" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
swc = "0.264.38" | |
$ cargo tree |
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
# /etc/wmbusmeters.d/ColdWater | |
name=ColdWater | |
# the id printed on the meter | |
id=030xxxxx | |
key=NOKEY | |
driver=hydrodigit |
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
/** | |
* Terminating link that directly calls the tRPC router | |
*/ | |
export function createTestLink<TRouter extends AnyRouter>(opts: { | |
headers: () => Promise<Record<string, string>>; | |
router: TRouter; | |
}): TRPCLink<TRouter> { | |
return () => { | |
return (runtime) => { | |
return observable((observer) => { |
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
FROM node:14-slim | |
ENV NODE_ENV=production | |
COPY pnpm-deploy-output /app | |
WORKDIR /app | |
ENTRYPOINT ["/app/entrypoint.sh"] |
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
function getScrollContainer(node: HTMLElement | null): HTMLElement | null { | |
if (!node) { | |
return null; | |
} | |
if (node.scrollHeight > node.clientHeight) { | |
if (node === document.body) { | |
return document.documentElement; | |
} | |
return node; |
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
interface ViewProps<T> { | |
as?: T; | |
ref?: React.Ref< | |
T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : T | |
>; | |
children?: React.ReactNode; | |
} | |
declare function ViewType<T extends ElementType = "div">( | |
props: React.ComponentPropsWithoutRef<T> & ViewProps<T>, |
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
/** | |
* Render a div which preserves its server-side content on browser hydration. | |
*/ | |
function NoHydrate(props: { id?: string; children: React.ReactNode }) { | |
const id = props.id ?? "no-hydrate"; | |
const container = useRef<HTMLDivElement>(null); | |
const save = useRef<Node[]>(); | |
// During the first render capture clones of the children. Reading the DOM | |
// during React render is a hack but the only way to access the DOM before |
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
import { json } from "@remix-run/node"; | |
import { useActionData, useLoaderData } from "@remix-run/react"; | |
export function useTypedLoaderData<T extends (arg: any) => any>(): Awaited< | |
ReturnType<T> | |
> { | |
return useLoaderData(); | |
} | |
export function useTypedActionData<T extends (arg: any) => any>(): |
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
import { DataFunctionArgs } from "@remix-run/node"; | |
export async function loader({ request }: DataFunctionArgs) { | |
const user = getUser(request); | |
return typedJson({ | |
email: user.email, | |
}); | |
} |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Jest Current File", | |
"runtimeExecutable": "sh", // <-- The important bit! | |
"program": "node_modules/.bin/jest", | |
"args": ["${relativeFile}"], |
NewerOlder