Skip to content

Instantly share code, notes, and snippets.

View asela38's full-sized avatar

Asela Illayapparachchi asela38

View GitHub Profile
# LLM Wiki at Work
A pattern for building a **work-context second brain** using LLMs.
This is an idea file; it is designed to be copied and pasted into your own LLM Agent (Claude Code or similar) to bootstrap a new vault dedicated to office/project/professional work. Its goal is to communicate the high-level pattern; your agent will build out the specifics in collaboration with you. It is a sibling of the personal-knowledge version described in [[llm-wiki]].
## The core idea
At work, you read and generate enormous amounts of textual material every day: meeting notes, standup updates, design documents, code reviews, tickets, Slack threads, architectural decisions, stakeholder emails, and AI-assistant conversations about your own codebase. Most of it is written to be forgotten. When the same question comes up three sprints later, you re-derive the answer — or you ask a colleague who re-derives it — or you stare at the pull request that resolved it and can't remember why the resolution made sense. Professio
@asela38
asela38 / llm-wiki.md
Created April 18, 2026 14:28 — 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.

@asela38
asela38 / gist:94505f908630c06c7eb9b691457097e6
Created June 5, 2019 12:16
Compile and Run Hello World Java Appliation
➜ Test docker pull java
Using default tag: latest
latest: Pulling from library/java
5040bd298390: Pull complete
fce5728aad85: Pull complete
76610ec20bf5: Pull complete
60170fec2151: Pull complete
e98f73de8f0d: Pull complete
11f7af24ed9c: Pull complete
49e2d6393f32: Pull complete

Take all properties from a pojo and enclose them inside a tag

$ grep private myPojo.java  | cut -d' ' -f7 | sed -e 's$\(.*\);$<value>\1</value>$g' 

Kill all processors which mactch a perticular user

$ ps ef | grep user123 | cut -d' ' -f2- | sed 's/^\s*//g' | cut -d' ' -f1 | grep "[0-9]" | xargs -n1 kill -9 
@asela38
asela38 / pom.xml
Created September 25, 2018 04:46
My Basic Default POM
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.asela.test</groupId>
<artifactId>application</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Application</name>

curl -s "wttr.in"

Weather report: Singapore, Singapore

    \  /       Partly cloudy
  _ /"".-.     30-35 °C
    \_(   ).   ↑ 17 km/h
    /(___(__)  10 km
 4.0 mm
@asela38
asela38 / java8-one-liners-for-statistical-properties.md
Last active May 11, 2023 23:54
Java 8 One liners for statistical properties : Mean, Mode, Median(Q2), Q1, Q2, Variance, Standard Deviation

While working on a Hacker Rank Problem I wrote few one lines using java stream to find mean, median, mode, Q1, Q3, variance and standard deviation. Thought to share since it's quite interesting.

        // mean
        double mean = list.stream().mapToInt(Integer::intValue).average().getAsDouble();
        System.out.println(mean);
        
        // mode - create count map using group by and sorted with custom comparator to give minimum from competing probable mode values
        Integer mode = list.stream()
                .collect(Collectors.groupingBy(i -> i, () -> new TreeMap<Integer, Long>(), Collectors.counting()))

Most used Terminal Line Commands

when working on the terminal line

Use command
Toggle Between begining of line and End of Line CTRL+XX
Delete Last Word
Before:
>test one two |
After:
>test one |
ALT + BACKSPACE
Cut last Word
Before:
>test one two |
After:
>test one |
CTRL+W
Paste last cut CTRL+Y

Creating a Shell Script to Create New Shell Scripts Based on a Template

For this example, I am creating a shell script to create another shell script that prints a specific message based on a template.

Template File Name : script-XXX.template

Content of the Template:

#!/bin/sh