Skip to content

Instantly share code, notes, and snippets.

@olimorris
olimorris / nvim-treesitter.rb
Created April 12, 2026 08:52
Tree-sitter in Neovim without nvim-treesitter
#!/usr/bin/env ruby
# frozen_string_literal: true
require "fileutils"
require "tmpdir"
TREESITTER_DIR = File.expand_path("~/.local/share/nvim/treesitter")
PARSER_DIR = File.join(TREESITTER_DIR, "parser")
QUERIES_DIR = File.join(TREESITTER_DIR, "queries")
@Zejnilovic
Zejnilovic / github_ref.lua
Created January 5, 2026 10:34
A small Neovim helper that opens GitHub references under the cursor (or visual selection) in a browser. This is editor-native. No plugins, no API calls, no Tree-sitter, no LSP. Just Lua.
--[[
github_ref.lua
A small, editor-native Neovim helper for opening GitHub references found
under the cursor or in a visual selection.
This file intentionally avoids plugins, GitHub API calls, Tree-sitter,
LSP integration, or background jobs. It is designed to be fast, predictable,
and usable anywhere text appears (code, documentation, comments, or notes).
@itsfrank
itsfrank / codecompanion-save.lua
Last active August 6, 2026 04:12
Snippet to add the ability to save/load CodeCompanion chats in neovim
-- add 2 commands:
-- CodeCompanionSave [space delimited args]
-- CodeCompanionLoad
-- Save will save current chat in a md file named 'space-delimited-args.md'
-- Load will use a telescope filepicker to open a previously saved chat
-- create a folder to store our chats
local Path = require("plenary.path")
local data_path = vim.fn.stdpath("data")
local save_folder = Path:new(data_path, "cc_saves")

Slash Commands

The following are some notes taken while testing and intercepting requests from the Zed Assistant Panel (Zed version 0.150.4) to their server hosting Claude 3.5 Sonnet model.

@mactep
mactep / conceal.lua
Last active June 7, 2025 10:59
Conceal html class attribute values using treesitter
-- THIS IS DEPRECATED, USE THE FILE BELOW
-- should get bufnr from autocmd or something
-- conceal only accepts one character
-- thanks to u/Rafat913 for many suggestions and tips
local namespace = vim.api.nvim_create_namespace("class_conceal")
local group = vim.api.nvim_create_augroup("class_conceal", { clear = true })
local conceal_html_class = function(bufnr)
@VonHeikemen
VonHeikemen / better-netrw.vim
Last active November 12, 2026 15:25
Making a more intuitive netrw
" Open Netrw on the directory of the current file
nnoremap <leader>dd :Lexplore %:p:h<CR>
" Toggle the Netrw window
nnoremap <Leader>da :Lexplore<CR>
if &columns < 90
" If the screen is small, occupy half
let g:netrw_winsize = 50
else
@peterhurford
peterhurford / install_xelatex_on_mac.txt
Last active October 21, 2026 04:57
How to install latex and xelatex on Mac so that Jupyter "Download as PDF" will work
brew install pandoc
brew tap homebrew/cask
brew install --cask basictex
eval "$(/usr/libexec/path_helper)"
# Update $PATH to include `/usr/local/texlive/2022basic/bin/universal-darwin`
sudo tlmgr update --self
sudo tlmgr install texliveonfly
sudo tlmgr install xelatex
sudo tlmgr install adjustbox
sudo tlmgr install tcolorbox
@olimorris
olimorris / Dockerfile
Last active May 31, 2024 16:23
Use Docker to install MS-SQL Server 2017 with Full Text Search and MS-SQL Tools
# mssql-agent-fts-ha-tools
# Maintainers: Microsoft Corporation (twright-msft on GitHub)
# GitRepo: https://github.com/Microsoft/mssql-docker
# Base OS layer: Latest Ubuntu LTS
FROM ubuntu:16.04
# Install curl since it is needed to get repo config
# Get official Microsoft repository configuration
RUN export DEBIAN_FRONTEND=noninteractive && \
@andrewdelprete
andrewdelprete / webpack.mix.js
Last active August 28, 2024 21:30
Laravel Mix: Tailwind CSS + PurgeCSS Example
let mix = require("laravel-mix");
let tailwindcss = require("tailwindcss");
let glob = require("glob-all");
let PurgecssPlugin = require("purgecss-webpack-plugin");
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
* https://github.com/FullHuman/purgecss-webpack-plugin
*/
@koba04
koba04 / app.css
Last active August 10, 2026 17:53
socket.io chat sample by vue.js http://socket.io/get-started/chat/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font: 13px Helvetica, Arial;
}