Skip to content

Instantly share code, notes, and snippets.

View dereknguyen269's full-sized avatar
๐Ÿ‘‹
I may be slow to respond.

Derek dereknguyen269

๐Ÿ‘‹
I may be slow to respond.
View GitHub Profile
@dereknguyen269
dereknguyen269 / llm-wiki.md
Created April 12, 2026 02:02 — 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.

@dereknguyen269
dereknguyen269 / ph.geojson
Last active March 20, 2025 05:41
Geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
0x636c48edbedd078cd9e196dc6c2154c7f82e73b0
@dereknguyen269
dereknguyen269 / main.go
Created October 27, 2023 07:02
Go Code Demo
package main
import "fmt"
func main() {
// Declare a variable of type int
var age int
// Get the user's age
fmt.Println("Enter your age:")
@dereknguyen269
dereknguyen269 / metaprogramming.md
Created December 5, 2022 03:19 — forked from BrianSigafoos/metaprogramming.md
Metaprogramming in Ruby

Dynamic Method

# Decide how to define a method at runtime
class C
end

C.class_eval do
  define_method :my_method do
    'a dynamic method'
 end
@dereknguyen269
dereknguyen269 / curl.md
Created October 14, 2022 09:12 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@dereknguyen269
dereknguyen269 / setup_railson_mac_m1.md
Last active May 25, 2023 14:31
Setup project rails 4.2.x and ruby 2.5.x on Mac M1

I've some problem when setup project with:

  • Rails 4.2.10
  • Ruby 2.5.3
  • Postgresql 13

My steps:

Install Homebrew

@dereknguyen269
dereknguyen269 / calculate.rb
Created September 30, 2020 08:13
Distance between two points on earth with Ruby
# https://www.geeksforgeeks.org/program-distance-two-points-earth/
earthRadius = 6371 # km
d_lat = (origin[:lat] - destination[:lat]) / 180.0 * Math::PI
d_lng = (origin[:lng] - destination[:lng]) / 180.0 * Math::PI
sin_lat = Math.sin(d_lat / 2)
sin_lng = Math.sin(d_lng / 2)
rad_lat1 = origin[:lat] / 180.0 * Math::PI
rad_lat2 = destination[:lat] / 180.0 * Math::PI
a = (sin_lat * sin_lat) + (sin_lng * sin_lng) * Math.cos(rad_lat1) * Math.cos(rad_lat2)
@dereknguyen269
dereknguyen269 / curl
Created June 24, 2020 13:17
How To Check URL Is Working Or Not In Programing Languages?
$url = "http://www.domain.com/demo.jpg";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_NOBODY, true);
$result = curl_exec($curl);
if ($result !== false)
{
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($statusCode == 404)
{
echo "URL Not Exists"
@dereknguyen269
dereknguyen269 / queries_and_update_property_in_json_column_with_rails.rb
Last active March 13, 2020 03:08
Queries And Update Property In JSON Column With Rails
# Table Driver
# Id : Integer
# Name : String
# Vehicle Attributes : JSON
# Example:
# {
# id: 1,
# name: 'Driver Name',
# vehicle_attributes: {