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}"], |
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 NotNill<T> = T extends null | undefined ? never : T; | |
type Primitive = undefined | null | boolean | string | number | Function; | |
type DeepRequired<T> = T extends Primitive | |
? NotNill<T> | |
: { | |
[P in keyof T]-?: T[P] extends Array<infer U> | |
? Array<DeepRequired<U>> | |
: T[P] extends ReadonlyArray<infer U2> |
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
$ 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
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("") | |
base = alphabet.length | |
exports.encode = (i) -> | |
return alphabet[0] if i is 0 | |
s = "" | |
while i > 0 | |
s += alphabet[i % base] | |
i = parseInt(i / base, 10) |
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
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
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
#!/bin/sh | |
mountroot_fail() | |
{ | |
if [ -x /sbin/lvm ]; then | |
echo "Trying to fix lvm" | |
set -x | |
/sbin/lvm vgscan | |
/sbin/lvm vgchange -a y --sysinit |
NewerOlder