Skip to content

Instantly share code, notes, and snippets.

View rawnly's full-sized avatar
🧨
fixing my printer

Federico rawnly

🧨
fixing my printer
View GitHub Profile
---@class KeyMapping
---@field lhs string The key sequence
---@field icon string The icon
---@field fn fun(bufnr: integer) # Function to execute, receives buffer number
---@field desc string Description for which-key / documentation
---@class MappingsModule
---@field setup fun(keys: KeyMapping[], bufnr: integer) Sets up buffer-local mappings
local M = {}
---@class KeyMapping
---@field lhs string The key sequence
---@field icon string The icon
---@field fn fun(bufnr: integer) # Function to execute, receives buffer number
---@field desc string Description for which-key / documentation
---@class MappingsModule
---@field setup fun(keys: KeyMapping[], bufnr: integer) Sets up buffer-local mappings
local M = {}
---@type Terminal
local lazygit
---@type Terminal
local devserver
local function close_on_q(bufnr)
vim.cmd("startinsert!")
vim.api.nvim_buf_set_keymap(bufnr, "n", "q", "<cmd>close<cr>", {
noremap = true,
---@type LazySpec
return {
{ "akinsho/git-conflict.nvim", version = "*", config = true },
{
"rawnly/gist.nvim",
opts = {
platform = "pastecn",
},
},
{
@rawnly
rawnly / manifest.json
Created February 5, 2026 18:10
redirecto chrome ext
{
"version": "0.0.1",
"manifest_version": 3,
"name": "redirecto",
"description": "Redirects",
"permissions": [
"declarativeNetRequest"
],
"host_permissions": [
"*://*.npmjs.com/*"
local utils = require("gist.core.utils")
local M = {}
-- @param filename string UNSUPPOTED
-- @param content string|nil UNSUPPOTED
-- @param description string UNSUPPOTED
-- @param private boolean UNSUPPOTED
function M.create(_, content, _, _)
local config = require("gist").config.platforms.termbin
-- Set buffer to be readonly
vim.api.nvim_buf_set_option(buf, "readonly", true)
vim.api.nvim_buf_set_option(buf, "modifiable", false)
vim.api.nvim_buf_set_name(
buf,
string.format("gist://%s/%s", gist.hash, gist.name)
)
-- Set winbar
local winbar = string.format("%%=GIST `%s` [READ-ONLY]", gist.name)
#!/usr/bin/env bash
## Usage
# better_cat <file>
# better_cat package.json -r '[.name, .version] | join("@")'
# better_cat README.md
if [ -z "$1" ]; then
echo "Usage: better_cat <file>"
exit 1
WITH
query_embedding AS (
SELECT ai.openai_embed(
'text-embedding-3-small',
${query},
${OPENAI_API_KEY}
) AS embedding
),
scored AS (
SELECT
#!/bin/bash
# List uncommitted changes and
# check if the output is not empty
if [ -n "$(git status --porcelain)" ]; then
# Print error message
printf "\nError: repo has uncommitted changes\n\n"
# Exit with error code
exit 1
fi