Skip to content

Instantly share code, notes, and snippets.

View mattcargile's full-sized avatar

Matt Cargile mattcargile

  • Baton Rouge, LA
View GitHub Profile
@Jaykul
Jaykul / gcixel.ps1
Created September 1, 2024 04:55
ImageMagick and Sixels -- this is not fast, but it works even across ssh
<#
.SYNOPSIS
gcixels is like gci, but with sixels...
.DESCRIPTION
Shows thumbnails of images with titles, directly in terminal.
However, it's done with ImageMagick montage, so it's awfully slow.
Just sharing it for your inspiration.
.NOTES
Requires ImageMagick and a Sixel terminal (like Windows Terminal 1.22+ or WezTerm)
#>
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Management.Automation;
using Microsoft.PowerShell.Commands;
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class CmdletWithPathBase : PSCmdlet
@IISResetMe
IISResetMe / IndisposableStreamWrapper.ps1
Created April 29, 2025 19:08
Wrap Stream to prevent Close/Dispose in PowerShell classes
class IndisposableStream : IO.Stream {
hidden [IO.Stream] $_inner
IndisposableStream([IO.Stream]$inner) {
$this._inner = $inner
}
# proxy (almost) everything back to the inner stream object
hidden [bool] get_CanRead() { return $this._inner.CanRead }
hidden [bool] get_CanWrite() { return $this._inner.CanWrite }