Skip to content

Instantly share code, notes, and snippets.

View hsleedevelop's full-sized avatar
🔥

HS Lee hsleedevelop

🔥
View GitHub Profile
@hsleedevelop
hsleedevelop / llm-wiki.md
Created April 16, 2026 16:30 — 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.

@hsleedevelop
hsleedevelop / History|-10016df2|entries.json
Last active January 31, 2026 01:37
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/hsleeathome/Documents/Projects/web/react-sass-youtube-clone/src/scss/layout/index.scss","entries":[{"id":"wrcu.scss","timestamp":1705838985262},{"id":"suus.scss","timestamp":1705839013080},{"id":"NyEW.scss","source":"undoRedo.source","timestamp":1705839014151},{"id":"H4JN.scss","timestamp":1705839017424},{"id":"FAgg.scss","timestamp":1705839074268}]}
import Foundation
extension String {
//Know if self is only composed by numbers
var isNumber: Bool {
return !self.isEmpty && CharacterSet.decimalDigits.isSuperset(of: CharacterSet(charactersIn: self))
}
}
//Struct to check Regular Expresions
@hsleedevelop
hsleedevelop / Swift 3: How to implement a service extension.swift
Created September 7, 2022 13:00 — forked from barbaramartina/Swift 3: How to implement a service extension.swift
Swift 3: implement a service extension and download an image attachment.
//
// NotificationService.swift
// Service
//
// Created by Barbara Rodeker on 28/09/16.
// Copyright © 2016 Barbara Rodeker. All rights reserved.
//
import UserNotifications
typealias DataSource = UITableViewDiffableDataSource<Int, String>
typealias SnapShot = NSDiffableDataSourceSnapshot<Int, String>
private var dataSource: DataSource!
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
@hsleedevelop
hsleedevelop / functions.sh
Last active August 12, 2022 12:36
AlfredGist/functions.sh - python3
#!/bin/bash
OUR_DIR=$(cd $(dirname "$0"); pwd)
[[ ! -d "$PREF_DIR" ]] && mkdir -p "$PREF_DIR" 2>/dev/null
function echo_start_items() {
echo '<?xml version="1.0"?>'
echo '<items>'
}
@hsleedevelop
hsleedevelop / DialogOneButtonView.swift
Created August 12, 2022 12:29
Representable Implements
//
// DialogOneButtonView.swift
//
// Created by HS Lee on 2022/08/08.
//
import Foundation
import UIKit
import SwiftUI
@hsleedevelop
hsleedevelop / AuthService.swift
Created June 27, 2022 05:08 — forked from NunciosChums/AuthService.swift
Moya + renewal token when Unauthorized(401)
import Foundation
import Moya
import RxSwift
/// 인증 관련 API
final class AuthService: BaseService<AuthAPI> {
static let shared = AuthService()
private override init() {}
/// 토큰 재발급
@hsleedevelop
hsleedevelop / Safer SwiftUI Environment.md
Created June 15, 2022 04:49 — forked from anandabits/Safer SwiftUI Environment.md
Towards a safer SwiftUI environment

Towards a safer SwiftUI environment

Swift UI's @EnvironmentObject is currently prone to runtime errors. If a view uses an environment object of a type that was not injected using environmentObject a fatalError occurs. This document sketches a design that would support compile-time checking of environment object usage. It requires a few language enhancements.

Tuple intersection types

Swift's protocol composition types such as Protocol1 & Protocol2 are a form of intersection types. Other forms of intersection types are possible. For example, Flow has object intersection types. Tuple intersection types for Swift would be very similar to these.

Below, you can see the examples in the Flow documentation converted to Swift's tuples:

import Combine
import SwiftUI
@dynamicMemberLookup public protocol ViewModelBinding {
associatedtype State
associatedtype Input
var state: State { get }
mutating func bind(with input: PassthroughSubject<Input, Never>)
}