- IMPORTANT: Aim for simple and robust code with room to grow; let the code be smaller than your first instinct.
- Do not stop at “it runs.” Think: “Under what conditions does this work, and what happens outside them?”
- Before taking a shortcut, state the cost explicitly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local diagnostics_quickfix = function(_, _, result, _) | |
| if not result then return end | |
| local uri = result.uri | |
| local bufnr = vim.uri_to_bufnr(uri) | |
| local diagnostics = result.diagnostics | |
| if not bufnr then | |
| err_message("LSP.publishDiagnostics: Couldn't find buffer for ", uri) | |
| return | |
| end | |
| for _, v in ipairs(diagnostics) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| env: | |
| TERM: xterm-256color | |
| window: | |
| dimensions: | |
| columns: 120 | |
| lines: 100 | |
| decorations: full | |
| scrolling: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local M = {} | |
| local function has_non_whitespace(str) | |
| return str:match("[^%s]") | |
| end | |
| local function fill_qflist(lines) | |
| vim.fn.setqflist({}, "a", { | |
| title = vim.bo.makeprg, | |
| lines = vim.tbl_filter(has_non_whitespace, lines), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local input = os.getenv("PWD") .. "/2023/1/input.txt" | |
| local sum = 0 | |
| for num, i in io.lines(input) do | |
| local r = {} | |
| -- each line becomes a table of values | |
| for c in num:gmatch(".") do | |
| -- remove values that are not numbers | |
| local bit = tonumber(c) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Lumen Diff Extension | |
| * | |
| * /lumen-diff command lists all files the model has read/written/edited in the active session branch, | |
| * coalesced by path and sorted newest first. Selecting a file opens it in lumen | |
| */ | |
| import type { ExtensionAPI } from "@mariozechner/pi-coding-agent"; | |
| import { DynamicBorder } from "@mariozechner/pi-coding-agent"; | |
| import { |
OlderNewer