Skip to content

Instantly share code, notes, and snippets.

@ericclemmons
ericclemmons / example.md
Last active April 24, 2024 18:09
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@Jaykul
Jaykul / You Need To Implement Non-Generic.md
Created April 27, 2016 01:48
Implementing IEnumerator<T> in PowerShell

In order to implement IEnumerator<T> you have to explicitly implement the Current member for IEnumerator<T> and IEnumerator ... but PowerShell won't let you have two different implementations of the same property, nor will it let you explicitly implement an interface member. So we do one at a time, like this:

First, make a non-generic IEnumerator, but implemented with the type you want in the end:

    class __Generator : System.Collections.IEnumerator {
        [int]$Actual = 0

        [object]get_Current() {
            return $this.Actual