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
#!/bin/bash | |
RED="\e[31m" | |
ENDCOLOR="\e[0m" | |
echo "⏳ Checking for type errors..." | |
# Run tsc and capture the output | |
TYPE_ERRORS=$(tsc --project ./tsconfig.json 2>&1) |
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 { createId } from "@paralleldrive/cuid2"; | |
/** | |
* @param message The message intended for the user. | |
* | |
* Other params are for logging purposes and help us debug. | |
* @param cause The error that caused the rejection. | |
* @param context Additional data to help us debug. | |
* @param name A name to help us debug and filter logs. | |
* |
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 { faker } from "@faker-js/faker"; | |
import { Suspense, cache } from "react"; | |
import Link from "next/link"; | |
export const dynamic = "force-dynamic"; | |
export const revalidate = 0; | |
const salesFromDB = Array.from( | |
{ length: 21 }, | |
() => |
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
/** | |
* By default, Remix will handle generating the HTTP Response for you. | |
* You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ | |
* For more information, see https://remix.run/file-conventions/entry.server | |
*/ | |
import crypto from "node:crypto"; | |
import { PassThrough } from "node:stream"; | |
import type { EntryContext } from "@remix-run/node"; |
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
// Remember to install mini-svg-data-uri | |
// Follow me on twitter for memes @jordienr | |
import { type Config } from "tailwindcss"; | |
const { | |
default: flattenColorPalette, | |
} = require("tailwindcss/lib/util/flattenColorPalette"); | |
const svgToDataUri = require("mini-svg-data-uri"); | |
export default { |
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
@tailwind base; | |
@tailwind components; | |
@tailwind utilities; | |
@layer base { | |
html { | |
font-family: 'Rubik', system-ui, sans-serif; | |
} | |
} |
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
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406 | |
import { sql } from "drizzle-orm"; | |
const clearDb = async (): Promise<void> => { | |
const query = sql<string>`SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
AND table_type = 'BASE TABLE'; | |
`; |
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
// if you don't plan to upload only images : | |
/* | |
async function convertToFile(data: AsyncIterable<Uint8Array>) { | |
const chunks = []; | |
for await (const chunk of data) { | |
chunks.push(chunk); | |
} | |
return chunks; | |
} |
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
// Thanks https://github.com/colinhacks/zod/issues/372#issuecomment-830094773 | |
type Implements<Model> = { | |
[key in keyof Model]-?: undefined extends Model[key] | |
? null extends Model[key] | |
? z.ZodNullableType<z.ZodOptionalType<z.ZodType<Model[key]>>> | |
: z.ZodOptionalType<z.ZodType<Model[key]>> | |
: null extends Model[key] | |
? z.ZodNullableType<z.ZodType<Model[key]>> | |
: z.ZodType<Model[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 { HashtagIcon, XMarkIcon } from "@heroicons/react/24/outline"; | |
import type { LoaderArgs, MetaFunction } from "@remix-run/node"; | |
import { metaTitle } from "@helpers"; | |
import { useGetRootPath } from "@hooks"; | |
import { | |
IconLink, | |
Modal, |