Skip to content

Instantly share code, notes, and snippets.

View aldrichtr's full-sized avatar

Tim Aldrich aldrichtr

View GitHub Profile
@aldrichtr
aldrichtr / GitHub_PSModule.ps1
Created July 2, 2025 02:14 — forked from Badgerati/GitHub_PSModule.ps1
Example script for publishing a PowerShell module to the NuGet GitHub Package Registry
<# --
Register the GitHub Package Registry
-- #>
$username = '<github-username>'
$token = '<github-personal-token>'
$sourceName = 'GitHub'
$source = "https://nuget.pkg.github.com/$username/index.json"
# add the github package registry as a nuget source
@aldrichtr
aldrichtr / Update-TreeSitter.ps1
Created June 29, 2025 16:32 — forked from DinoChiesa/Update-TreeSitter.ps1
Update Tree Sitter langs to latest for Windows #ps1
<#
.SYNOPSIS
Downloads, extracts, renames, and symlinks the latest Emacs Tree-sitter grammars for Windows.
.DESCRIPTION
This script performs the following actions:
1. Fetches the latest "Release" from https://github.com/emacs-tree-sitter/tree-sitter-langs/releases.
2. Identifies and downloads the `tree-sitter-grammars-windows-0.XX.YYY.tar.gz` file to the system's TEMP directory.
3. Creates a new directory (e.g., `tree-sitter-v0.XX.YYY`) in the current working directory.
4. Extracts the contents of the downloaded archive into this new directory.
@aldrichtr
aldrichtr / build.org
Created April 7, 2025 21:47 — forked from LdBeth/build.org
Build Emacs 31 for Windows

Build Emacs with MSYS2

This document is an up-to-date guide on compile Emacs 31 on windows with MSYS2, and make a installation with native compile that can work without MSYS2.

The idea is after get a working Emacs, you may delete MSYS2 environment to free some disk space, and forget about rebuilding Emacs

@aldrichtr
aldrichtr / OutputToOutputWindow.js
Created November 3, 2024 22:18 — forked from exceedsystem/OutputToOutputWindow.js
An example of 'Output to output window' macro for VSCodeMacros extension
// [VSCode Macros] extension
// https://marketplace.visualstudio.com/items?itemName=EXCEEDSYSTEM.vscode-macros
// License:MIT
const vscode = require('vscode');
// Create an output window for this macro
if (global.phee7Bie === undefined) {
// Store the output channel in the global variable for nodeJS
// ※The variable name 'phee7Bie' just means a unique global variable of this macro in the node JS
global.phee7Bie = {

A metatable can be defined like

local t = setmetatable({}, {
  __tostring = function() return 'custom tostring behavior!' end
})

Here are the metamethods that you can define, and their behavior

Operators

@aldrichtr
aldrichtr / playground.rs
Last active July 25, 2024 17:49 — forked from anonymous/playground.rs
Function overloading paradigm in rust
struct SomeStruct;
impl SomeStruct {
fn new(ctor: MixedInts) {
match ctor {
_ => println!("Match arms can construct the type in different ways"),
}
}
}
@aldrichtr
aldrichtr / @@INTRO.md
Created June 30, 2024 13:11 — forked from abstraction/@@INTRO.md
My use of Taskwarrior

Getting Started

My Usage

I've been using this for several years now, so here are some of the ways I have set it up to be most productive. See my taskrc below for implementation details.

In general, I've had the most success by keeping lists of tasks short and to the point, avoiding the anxiety of seeing 100 tasks and feeling like I'm going to drown.

@aldrichtr
aldrichtr / Test-QualityCode.ps1
Created May 28, 2024 23:23 — forked from belotn/Test-QualityCode.ps1
Script to check formatting and best practice before committing
######################################################################
# SCRIPT: Test-CodeQuality.ps1 #
######################################################################
# Purpose #
# Script to check formatting and best practice before committing #
######################################################################
# Author : Nicolas #
######################################################################
# ChangeLog #
# 20201026 - Initial Release #
@aldrichtr
aldrichtr / VIMBinding.ps1
Created May 28, 2024 23:20 — forked from belotn/VIMBinding.ps1
KeyHandler and function for some VI text manipulation ci, ca, di and da in #Powershell #PSReadLine
Set-PSReadLineKeyHandler -Chord "c,i" -ViMode Command -ScriptBlock { VIChangeInnerBlock }
Set-PSReadLineKeyHandler -Chord "c,a" -ViMode Command -ScriptBlock { VIChangeOuterBlock }
Set-PSReadLineKeyHandler -Chord "d,i" -ViMode Command -ScriptBlock { VIDeleteInnerBlock }
Set-PSReadLineKeyHandler -Chord "d,a" -ViMode Command -ScriptBlock { VIDeleteOuterBlock }
Set-PSReadLineKeyHandler -Chord "c,s" -ViMode Command -ScriptBlock { VIChangeSurround }
Set-PSReadLineKeyHandler -Chord "d,s" -ViMode Command -ScriptBlock { VIDeleteSurround }
Set-PSReadLineKeyHandler -Chord "Ctrl+a" -ViMode Command `
-ScriptBlock { VIIncrement $args[0] $args[1] }
Set-PSReadLineKeyHandler -Chord "Ctrl+x" -ViMode Command `
-ScriptBlock { VIDecrement $args[0] $args[1] }
@aldrichtr
aldrichtr / coc.lua
Created May 7, 2024 20:28 — forked from dinhmai74/coc.lua
cocnvim
local M = {
"neoclide/coc.nvim",
branch = "master",
build = "yarn install --frozen-lockfile",
}
M.config = function()
-- Some servers have issues with backup files, see #649
vim.opt.backup = false
vim.opt.writebackup = false