Skip to content

Instantly share code, notes, and snippets.

View vinnymac's full-sized avatar
🤓

Vincent Taverna vinnymac

🤓
View GitHub Profile
@vinnymac
vinnymac / capital.eval.ts
Created January 15, 2025 07:52
Example of using evalite with Azure and autoevals Factuality
import { createAzure } from '@ai-sdk/azure';
import { streamText } from 'ai';
import { Levenshtein, type Scorer } from 'autoevals';
import { evalite } from 'evalite';
import { traceAISDKModel } from 'evalite/ai-sdk';
process.env.AZURE_API_KEY = process.env.AZURE_OPENAI_API_KEY;
process.env.AZURE_OPENAI_RESOURCE_NAME = process.env.AZURE_OPENAI_RESOURCE_NAME;
const azure = createAzure({
@vinnymac
vinnymac / create_unaccent_extension.sql
Created December 13, 2024 16:35
Slugify postgres functions for creating slugs from arbitrary text strings
CREATE EXTENSION IF NOT EXISTS "unaccent";
@vinnymac
vinnymac / README.md
Last active August 2, 2024 23:02
Next 14.2.5 patch to disable tsconfig rewrite
@vinnymac
vinnymac / silenceReactWarning.log
Created February 1, 2023 04:08
React 18 warning
Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot
@vinnymac
vinnymac / cannotAssignError.log
Created February 1, 2023 04:08
Cannot assign error
TypeError: Cannot assign to read only property 'reload' of object '[object Location]'
@vinnymac
vinnymac / installReact18TestingLibrary.sh
Created February 1, 2023 04:07
React 18 Testing Library Install
yarn remove @testing-library/react-hooks -W && \
yarn add -D @testing-library/react@latest -W
@vinnymac
vinnymac / tsc-output.log
Created February 1, 2023 04:06
TypeScript output
Found 342 errors in 196 files.
@vinnymac
vinnymac / circular-json-error.log
Last active February 1, 2023 04:18
Circular JSON error
TypeError: Converting circular structure to JSON
@vinnymac
vinnymac / react-18-codemod.sh
Created February 1, 2023 04:04
React 18 Codemod
# To run a particular React 18 code mod, e.g. `context-any`
npx types-react-codemod [codemod] [path-to-sg-root] [path-to-sg-next]
# Or if you prefer you can use the React 18 preset to run all mods
npx types-react-codemod preset-18 [path-to-sg-root] [path-to-sg-next]
@vinnymac
vinnymac / sg-next-deps.diff
Created February 1, 2023 04:03
SG Next Dependency Diff
"devDependencies": {
- "@testing-library/react": "^11.2.7",
- "@testing-library/react-hooks": "^8.0.1",
+ "@testing-library/react": "^13.4.0",
- "@types/react": "^17.0.20",
- "@types/react-dom": "^17.0.9",
- "@types/react-redux": "^7.1.11",
+ "@types/react": "^18.0.24",
+ "@types/react-dom": "^18.0.8",
- "typescript": "4.4.3",