Skip to content

Instantly share code, notes, and snippets.

View RhysSullivan's full-sized avatar
🔨
Building https://www.answeroverflow.com/

Rhys Sullivan RhysSullivan

🔨
Building https://www.answeroverflow.com/
View GitHub Profile
@RhysSullivan
RhysSullivan / demo.tsx
Last active February 24, 2024 05:05
100 LOC Typelytics Dashboard
import { ClientMap } from "./client-map";
import { events } from "../../events";
import { PostHog } from "@typelytics/posthog";
import { Chart } from "@typelytics/tremor";
import { Card, Grid, Text, Title } from "@tremor/react";
export default async function Home() {
const domain = "www.answeroverflow.com";
const posthog = new PostHog({
events,
let __next_loaded_action_key: CryptoKey;
export async function getActionEncryptionKey() {
if (__next_loaded_action_key) {
return __next_loaded_action_key;
}
const rawKey = process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY;
if (rawKey === undefined) {
throw new Error("Missing encryption key for Server Actions");
function makeBitfieldType<T extends readonly string[]>(values: T) {
return customType<{
data: Record<T[number], boolean>;
}>({
dataType() {
return `int`;
},
// @ts-ignore
fromDriver(value: number) {
return bitfieldToDict(value, values);
@RhysSullivan
RhysSullivan / gist:9f8d11443b70deadabfe3b6bdfb762d0
Created September 27, 2023 06:08
Drop in OG error detector
import { useEffect, useState } from 'react';
import { PopoverContent, PopoverTrigger } from '../primitives/ui/popover';
import { Popover } from '../primitives/ui/popover';
import { BsCardHeading } from 'react-icons/bs';
import { Button } from '~ui/components/primitives/ui/button';
import { FiAlertCircle } from 'react-icons/fi';
import { TbAlertCircleFilled } from 'react-icons/tb';
type HeadValues = {
title?: string;
canonical?: string;

Fiduciary License Agreement 2.0

(based on the)

Individual Contributor Exclusive License Agreement

(including the Traditional Patent License OPTION)