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

Fiduciary License Agreement 2.0

(based on the)

Individual Contributor Exclusive License Agreement

(including the Traditional Patent License OPTION)

@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;
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);
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");
@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,
@RhysSullivan
RhysSullivan / extension.js
Created August 1, 2024 05:10
Replace your `/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js` with the following to use bun instead of node for your TypeScript server
This file has been truncated, but you can view the full file.
(() => {
var e = {
670: (e, t, n) => {
"use strict";
n.r(t),
n.d(t, {
AppInsightsCore: () => m,
BaseTelemetryPlugin: () => A.s,
DiagnosticLogger: () => u.wq,
EventLatency: () => b,
rhyssullivan@Rhyss-Laptop ~ % ab -n 1000 -c 10 https://galaxyscale-qt2hwmj5e-rhyssullivans-projects.vercel.app/
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking galaxyscale-qt2hwmj5e-rhyssullivans-projects.vercel.app (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
rhyssullivan@Rhyss-Laptop ~ % ab -n 1000 -c 10 https://galaxyscale.vercel.app/
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking galaxyscale.vercel.app (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
rhyssullivan@Rhyss-Laptop ~ % ab -n 1000 -c 100 https://galaxyscale-qt2hwmj5e-rhyssullivans-projects.vercel.app/
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking galaxyscale-qt2hwmj5e-rhyssullivans-projects.vercel.app (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
rhyssullivan@Rhyss-Laptop ~ % ab -n 1000 -c 100 https://galaxyscale.vercel.app/
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking galaxyscale.vercel.app (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests