Skip to content

Instantly share code, notes, and snippets.

View kerryChen95's full-sized avatar
🎯
Focusing

Kerry kerryChen95

🎯
Focusing
View GitHub Profile

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.

@paulirish
paulirish / what-forces-layout.md
Last active November 10, 2026 16:53
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@wintercn
wintercn / adhocSort.js
Created September 30, 2013 03:19
假期前小玩意,ad-hoc排序
function shuffle(array){
for(var i = array.length-1; i > 0; i--) {
var rnd = Math.floor(Math.random() * (i+1));
var tmp = array[i];
array[i] = array[rnd];
array[rnd] = tmp;
}
}
function isInOrder(array) {
for(var i = 0; i < array.length-1; i++)
[
{
name:"HTML5",
uri:"http://www.w3.org/TR/html5/single-page.html",
category:"markup"
},
{
name:"HTML 5.1",
uri:"http://www.w3.org/TR/html51/single-page.html",
category:"markup"
@dreamsky
dreamsky / magnifier.html
Created June 10, 2013 06:29
前端试题:图片放大镜
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Magnifier Demo</title>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
@dreamsky
dreamsky / callee.js
Last active February 12, 2020 10:08
优秀的 JavaScript 代码片段集合
//JavaScript callee 用法示例
function factorial(num) {
if (num <= 1) {
return 1;
} else {
return num * arguments.callee(num - 1);
}
}
@dreamsky
dreamsky / css3-font-animation
Created May 29, 2013 07:32
前端试题:CSS3 文字放大效果
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>前端试题:CSS3 文字放大效果</title>
</head>
<style>
a {
display: table-cell;
width: 220px;
@dreamsky
dreamsky / nine-grid.html
Created May 29, 2013 07:11
前端试题:CSS 九宫格效果
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Nine Grid</title>
<style>
ul {
width: 165px;
padding: 30px;
}
@gonghao
gonghao / example.js
Created December 28, 2012 14:55
Empty an Array with JavaScript
myArray = []; // bad
myArray.length = 0; // good!
@kejun
kejun / dabblet.css
Created December 7, 2012 02:17
Untitled
.mod {
position: absolute;
width: 300px;
background: #eee;
border: 1px solid #eee;
padding: 0 50px;
-webkit-box-shadow: 0 0 4px 0 rgba(0,0,0,0.2);
-moz-box-shadow: 0 0 4px 0 rgba(0,0,0,0.2);
box-shadow: 0 0 4px 0 rgba(0,0,0,0.2);
top: 50%;