April 2026 TLDR setup for Ollama + Gemma 4 on a Mac mini (Apple Silicon) — auto-start, preload, and keep-alive
- Mac mini with Apple Silicon (M1/M2/M3/M4/M5)
- At least 16GB unified memory for Gemma 4 (default 8B)
- macOS with Homebrew installed
April 2026 TLDR setup for Ollama + Gemma 4 on a Mac mini (Apple Silicon) — auto-start, preload, and keep-alive
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.
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.
| #!/bin/bash | |
| # 智能session命名:使用当前目录名或自定义名称 | |
| if [ -z "$1" ]; then | |
| SESSION_NAME=$(basename "$PWD" | tr '.' '-' | tr ' ' '-') | |
| else | |
| SESSION_NAME=$1 | |
| fi | |
| # 检查session是否已存在 | |
| tmux has-session -t "$SESSION_NAME" 2>/dev/null |
This gist takes heavy inspiration from kevin-smets / iterm2-solarized.md gist for iTerm2.
The first thing that you will want to do is install WSL 2 and a Linux distro.
| """ | |
| The most atomic way to train and inference a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
You are an expert full-stack developer with deep knowledge of Bolt.new, modern web frameworks, and rapid application development. You have studied extensive tutorials covering authentication, databases, payments, deployment, and AI integration. Your goal is to create production-ready applications in a single prompt using industry best practices.
| import { useSyncExternalStore } from "react"; | |
| // For more on the useSyncExternalStore hook, see https://react.dev/reference/react/useSyncExternalStore | |
| // The code is almost identical to the source code of zustand, without types and some features stripped out. | |
| // Check the links to see the references in the source code. | |
| // The links are referencing the v5 of the library. If you plan on reading the source code yourself v5 is the best way to start. | |
| // The current v4 version contains lot of deprecated code and extra stuff that makes it hard to reason about if you're new to this. | |
| // https://github.com/pmndrs/zustand/blob/fe47d3e6c6671dbfb9856fda52cb5a3a855d97a6/src/vanilla.ts#L57-L94 | |
| function createStore(createState) { |
| package br.com.zup.edu.app2.xxx.samples.aws.sqs; | |
| import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.Customer; | |
| import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.CustomerRepository; | |
| import io.awspring.cloud.messaging.listener.SqsMessageDeletionPolicy; | |
| import io.awspring.cloud.messaging.listener.annotation.SqsListener; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | |
| import org.springframework.messaging.handler.annotation.Header; |
| node: Platform built on V8 to build network applications | |
| git: Distributed revision control system | |
| wget: Internet file retriever | |
| yarn: JavaScript package manager | |
| python3: Interpreted, interactive, object-oriented programming language | |
| coreutils: GNU File, Shell, and Text utilities | |
| pkg-config: Manage compile and link flags for libraries | |
| chromedriver: Tool for automated testing of webapps across many browsers | |
| awscli: Official Amazon AWS command-line interface | |
| automake: Tool for generating GNU Standards-compliant Makefiles |