Skip to content

Instantly share code, notes, and snippets.

@hunandy14
hunandy14 / X509Certificate2.psm1
Created July 15, 2025 15:36 — forked from heaths/X509Certificate2.psm1
X509Certificate2 PowerShell module
#Requires -Version 6.0
using namespace System.Security.Cryptography
using namespace System.Security.Cryptography.X509Certificates
using namespace System.Text
<#
.Synopsis
Generate an X509 v3 certificate.
@heaths
heaths / X509Certificate2.psm1
Last active July 15, 2025 15:37
X509Certificate2 PowerShell module
#Requires -Version 6.0
using namespace System.Security.Cryptography
using namespace System.Security.Cryptography.X509Certificates
using namespace System.Text
<#
.Synopsis
Generate an X509 v3 certificate.
@mklement0
mklement0 / Out-FileUtf8NoBom.ps1
Last active May 2, 2025 01:58
PowerShell function that emulates Out-File for creating UTF-8-encoded files *without a BOM* (byte-order mark).
<#
Prerequisites: PowerShell version 3 or above.
License: MIT
Author: Michael Klement <[email protected]>
DOWNLOAD and DEFINITION OF THE FUNCTION:
irm https://gist.github.com/mklement0/8689b9b5123a9ba11df7214f82a673be/raw/Out-FileUtf8NoBom.ps1 | iex
The above directly defines the function below in your session and offers guidance for making it available in future
@jeetsukumaran
jeetsukumaran / custom_iterator.cpp
Created February 18, 2010 02:33
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>