Skip to content

Instantly share code, notes, and snippets.

@AndrewRadev
AndrewRadev / update-academic-spelling.sh
Created February 20, 2025 10:06
Download a pair of spellfiles and convert them to Vim's
#!/bin/sh
# Adapted from:
# https://github.com/ficcdaf/academic.nvim/blob/83865969059b2aaea2e7afcebaa60085e965d9f8/scripts/generate-wordlist.sh
# Adjust to your home directory:
VIM_HOME="$HOME/.vim"
DOWNLOAD_TARGET="$VIM_HOME/spell/en-academic"
# The "unmunch" command comes with "hunspell":
@twsh
twsh / scrlttr2.latex
Created June 6, 2024 12:30
The template from https://github.com/JensErat/pandoc-scrlttr2 updated for Pandoc 3.1.3
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
\PassOptionsToPackage{hyphens}{url}
$if(colorlinks)$
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
$endif$
$if(CJKmainfont)$
\PassOptionsToPackage{space}{xeCJK}
$endif$
%
@girishji
girishji / vim9cmdline.md
Last active June 6, 2024 09:14
Vim Tip: Vim9script in Command Line

Note: This gist is now part of VimBits plugin.

As a Vim user, you might prefer the new vim9script over the legacy script, and wish to use it in the command line. While there's no direct option to switch the command line to parse vim9script, you can execute vim9script commands by simply prepending each command with vim9.

However, remember that execution occurs in the global context, not the script-local context. This means you need to declare variables with the g: prefix, like g:foo = 'bar'.

Common commands such as visual mode select ('<,'>), shell commands (!), substitution (s//), and global (g//) work as expected, even with vim9 prepended.

@pythoninthegrass
pythoninthegrass / dl-gh
Last active July 22, 2025 08:05
Download latest GitHub releases by user, repo, and extension
#!/usr/bin/env bash
# shellcheck disable=SC2207
base_url="https://github.com/$user_name/$repo_name/releases"
pkg_path=$(pwd)
distro=$(uname) # Linux / Darwin
arch=$(uname -m) # x86_64 / aarch64 / arm64
help() {
@pythoninthegrass
pythoninthegrass / .gitignore
Last active July 22, 2025 08:05
Generates self-signed certs for local development
# ETC
**/certs/*
# INCLUDE
# General
.DS_Store
.AppleDouble
.LSOverride
@kennypete
kennypete / _gvim-kennypete-toolbar.adoc
Last active February 12, 2024 18:06
Customising a gvim toolbar

My gvim toolbar

@apirogov
apirogov / rsync-prepare
Created September 7, 2022 18:08
Script to fix moved/renamed files before running rsync to avoid useless retransmissions
#!/usr/bin/env python3
"""
Fix moved/renamed files before running rsync to avoid useless retransmissions.
Copyright (C) 2022 Anton Pirogov, licensed under the MIT License
"""
from itertools import chain
from typing import List, Dict, Optional
from dataclasses import dataclass
from pathlib import Path
@PJB3005
PJB3005 / linux_sucks.md
Last active August 1, 2025 21:56
Summary of all problems I have with the Linux Desktop

Linux Desktop Issues

This is basically my manifesto of why Linux sucks and I keep using Windows as a desktop OS. This is both as a developer platform and end-user targeting.

Look: I would love to be able to use Linux as a daily driver. KDE is amazing and they clearly put far more effort into the desktop experience/UI than Windows (just the volume mixer alone). There are simply far too many underlying and infrastructural problems to the Linux desktop that none of KDE's great UI changes can make up for. I want Linux fanboys, developers, etc... to stop sticking their damn head in the sand about these issues and admit that Linux is still decades behind in some basic infrastructure. This shit can't get fixed if people refuse to admit it's broken in the first place, which some people are far too happy to do.

Desktop App Experience & Developer Tools

Windows has far better desktop apps than Linux, and thanks to WSL, I have all the CLI apps of Linux too. While I do believe KDE Plasma is a much better desk

@mklement0
mklement0 / Show-Help.ps1
Last active May 2, 2025 01:48
Wrapper PowerShell function for Get-Help that shows help topics online by default and supports copying URLs of / Markdown links to the online help topics to the clipboard
<#
Prerequisites: PowerShell v5.1 and above (verified; may also work in earlier versions)
License: MIT
Author: Michael Klement <[email protected]>
DOWNLOAD and DEFINITION OF THE FUNCTION:
irm https://gist.github.com/mklement0/880624fd665073bb439dfff5d71da886/raw/Show-Help.ps1 | iex