mock.Mock()
mock.MagicMock()
assert_called_with: This method asserts that the last call was made with the given parameters
| "use strict"; | |
| let paramRegex = /([a-zA-Z0-9]+\=[a-zA-Z0-9]+)/ig; | |
| location.search.match(paramRegex); |
| How to convert existing phoenix app to an umbrella app. | |
| https://elixir-lang.slack.com/archives/phoenix/p1472921051000134 | |
| chrismccord [10:14 PM] | |
| @alanpeabody yes, it's straightforward | |
| [10:14] | |
| 1) mix new my_umbrella --umbrella |
| #!/bin/bash | |
| # See https://github.com/docker-library/mongo/pull/63 | |
| docker run --rm --volumes-from my-mongo-server mongo unlink "/data/db/mongod.lock" | |
| docker run --rm --volumes-from my-mongo-server mongo --repair |
| def answer(map, git_gud=True): | |
| """Find the shortest path in a binary 2D map where a wall can be removed. | |
| The algorithm uses a modified Dijstra's algorithm to find the shortest path | |
| from the start vertex (0,0) to the end vertex (w-1,h-1) in a 2D binary map. | |
| A single wall can be removed from the map to make the shortest path, if | |
| necessary. The first wall in any path can be ignored easily, but if a wall | |
| is necessary to be removed for a valid solution to exist the simple | |
| algorithm does not remember the minimum path that does not pass through a | |
| wall to arrive at the mandatory wall vertex. Therefore we modify the |
| terraform { | |
| required_version = ">=0.12, <0.13" | |
| } |
| """ | |
| The most atomic way to train and run inference for 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 |
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.