Skip to content

Instantly share code, notes, and snippets.

View sahilahluwalia's full-sized avatar

Sahil Ahluwalia sahilahluwalia

View GitHub Profile
@ciiqr
ciiqr / zod-optional-null.ts
Last active July 1, 2024 09:53
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{
@stvhwrd
stvhwrd / website-dl.md
Last active June 5, 2024 07:12
Download an entire website for offline use with wget. Internal inks will be corrected so that the entire downloaded site will work as it did online.

The best way to download a website for offline use, using wget

There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.

First make a folder to download the websites to and begin your downloading: (note if downloading www.SOME_WEBSITE.com, you will get a folder like this: /websitedl/www.SOME_WEBSITE.com/)


STEP 1: