Skip to content

Instantly share code, notes, and snippets.

View notcod's full-sized avatar
💭
I may be slow to respond.

notcod

💭
I may be slow to respond.
View GitHub Profile
@notcod
notcod / llm-wiki.md
Created July 3, 2026 01:22 — forked from karpathy/llm-wiki.md
llm-wiki

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@notcod
notcod / routes.tsx
Created July 18, 2024 08:25
routes.tsx
import { generatePreservedRoutes, generateRegularRoutes } from '@generouted/react-router/core';
import { createBrowserRouter, Outlet, RouterProvider } from 'react-router-dom';
import type { RouteObject } from 'react-router-dom';
import { Fragment } from 'react';
type Module = { default: () => JSX.Element; Catch?: () => JSX.Element };
const patterns = {
route: [/^.*\/src\/pages\/|\.(jsx|tsx|mdx)$/g, ''],
splat: [/\[\.{3}\w+\]/g, '*'],
const puppeteer = require('puppeteer');
const nodemailer = require('nodemailer');
class Webpage {
static async generatePDF(url) {
const browser = await puppeteer.launch({ headless: true }); // Puppeteer can only generate pdf in headless mode.
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'networkidle', networkIdleTimeout: 5000 }); // Adjust network idle as required.
const pdfConfig = {
format: 'A4',
//import Logo from '../assets/logo.png?jsx';
//<Logo/>
function ImageJSX() {
const supportedExtensions = ['.jpg', '.jpeg', '.png', '.webp', '.gif', '.avif', '.tiff'];
return {
name: 'my-plugin',
transform(code: any, id: any) {
const parseId = (originalId: string) => {
const [pathId, query] = originalId.split('?');
const queryStr = query || '';
@notcod
notcod / README.md
Last active March 20, 2024 16:34
Qwik clientAction$

Browser form action. When you need to submit form but you don't want to send request to server with regular routeAction$ Doesn't work when js disabled.

import { $ } from "@builder.io/qwik";
import type { RequestEventAction } from "@builder.io/qwik-city";
import { server$ } from "@builder.io/qwik-city";
interface CookieOption {
[key: string]: string;
}
interface Cookie {
name: string | undefined;
value: string | undefined;
options: CookieOption[] | undefined;
import {
component$,
Slot,
useStyles$,
} from "@builder.io/qwik";
import { Link, routeLoader$, useLocation } from "@builder.io/qwik-city";
import type { RequestHandler, LinkProps } from "@builder.io/qwik-city";
import Header from "~/components/starter/header/header";
import Footer from "~/components/starter/footer/footer";
@notcod
notcod / gist:79219f7339c7197bbe77ddc715f8bca2
Created August 6, 2023 11:05 — forked from stereokai/gist:36dc0095b9d24ce93b045e2ddc60d7a0
CSS rounded corners with gradient border
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: padding-box, border-box;
}
<?php
<?php
///amo integra begin
$values = $hook->getValues();
$subject = $modx->getOption('emailSubject', $formit->config, 'form-'.$modx->resource->get('emailSubject'));
$name = $values['name'];
$phone = $values['phone'];
$email = $values['email'];
@notcod
notcod / delven.sh
Last active February 19, 2023 16:22
#!/bin/bash
if [ -f "/etc/apache2/sites-available/$1.conf" ]
then
a2dissite $1.conf > /dev/null 2>&1
rm /etc/apache2/sites-available/$1.conf
rm -rf /var/www/$1
rm /etc/apache2/ssl/$1.pem
rm /etc/apache2/ssl/$1.key
else
echo "File is not found"