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
---@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
#! /bin/bash
# date (YYYY-MM-DD HH:MM:SS),percentage
datetime="$(date +%Y-%m-%d\ %H:%M:%S)"
memory_usage="$(ps -A -o %mem | awk '{ mem += $1 } END { print mem }')"
uptime="$(uptime | awk '{ print $3 }' | cut -d, -f1)"
# number only
battery_percentage="$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)"

Usage

type Payload = { username: string; password: string }
import { useForm, FormProvider } from 'react-hook-form'


function Form() {
  const methods = useForm<Payload>({
    mode: 'all',
 });
// Given this type
type ResultSuccess<T> = {
data: T
success: true
}
type ResultFailure<E> = {
error: E
success: false
}