Skip to content

Instantly share code, notes, and snippets.

@dfaivre
dfaivre / bootstrap.ps1
Last active March 16, 2026 14:25
Dev machine bootstrap scripts (Windows + Ubuntu/WSL2)
# bootstrap.ps1 - Public gist for zero-dependency machine setup
# Usage: iex (irm 'https://gist.githubusercontent.com/dfaivre/GIST_ID/raw/bootstrap.ps1')
#
# This script bootstraps a fresh Windows machine by:
# 1. Installing Git (required for chezmoi to clone private repos)
# 2. Installing Chezmoi (dotfiles manager)
# 3. Running chezmoi init --apply to clone and apply dotfiles
#
# The dotfiles repo contains run_once_* scripts that will automatically
# run to complete the full machine setup.
@dfaivre
dfaivre / PolyLabel.cs
Last active February 27, 2024 16:18
PolyLabel (pole of inaccessibility of a polygon) - C#/NTS
using System;
using System.Collections.Generic;
using System.Linq;
using GeoAPI.Geometries;
using NetTopologySuite.Geometries;
namespace Foo
{
/// <summary>
/// Finds the largest area inside a polygon (ie, for a label)