Skip to content

Instantly share code, notes, and snippets.

View ankddev's full-sized avatar
📖
Always learning!

Andrey ankddev

📖
Always learning!
View GitHub Profile
@ankddev
ankddev / open-with-nvim.reg
Last active May 10, 2025 08:48
Add "Open with Neovim" options to Windows context menu
; Add "Open with Neovim" options to Windows context menu
; It also accessible via <Win-Y>
; Originally taken from https://github.com/neovim/neovim/issues/6649#issuecomment-439865499
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\y Open with nvim]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\y Open with nvim\command]
@="C:\\Neovim\\bin\\nvim-qt.exe \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\y Open with nvim]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\y Open with nvim\command]
@="C:\\Neovim\\bin\\nvim-qt.exe \"%1\""
@ankddev
ankddev / main.rs
Last active April 13, 2025 15:37
Pretty panic handler for Rust
use std::panic::PanicHookInfo;
/// Setup panic handler
fn add_handler() {
std::panic::set_hook(Box::new(move |info: &PanicHookInfo<'_>| {
print_bug_message(info)
}));
}
/// Return ANSI escapes to print clickable link to terminal
@ankddev
ankddev / sysexits.md
Created March 29, 2025 13:09
Preferable exit codes for programs from `sysexits.h`

Prefereable exit codes for programs

The successful exit is always indicated by a status of 0. The meaning of the codes is approximately as follows:

Name Code Description
EX_USAGE 64 The command was used incorrectly, e.g., with the wrong number of arguments, a bad flag, a bad syntax in a parameter, or whatever.
EX_DATAERR 65 The input data was incorrect in some way. This should only be used for user's data and not system files.
EX_NOINPUT 66 An input file (not a system file) did not exist or was not readable. This could also include errors like "No message" to a mailer (if it cared to catch it).
EX_NOUSER 67 The user specified did not exist. This might be used for mail addresses or remote logins.
EX_NOHOST 68 The host specified did not exist. This is use
@ankddev
ankddev / envfetch.json
Last active April 8, 2025 12:38
A Scoop manifest for envetch - lightweight crossplatform CLI tool for working with environment variables
{
"version": "2.1.2",
"description": "Lightweigt crossplatform CLI tool for working with environment variables",
"homepage": "https://github.com/ankddev/envfetch",
"license": "MIT",
"bin": [ [ "envfetch-windows-amd64.exe", "envfetch" ] ],
"url": "https://github.com/ankddev/envfetch/releases/download/v2.1.2/envfetch-windows-amd64.exe",
"hash": "5580cedb6c7429494055741003a555c8fa18df745fe0fd8a29070a252c285141",
"checkver": "github",
"autoupdate": {