Skip to content

Instantly share code, notes, and snippets.

@imgen
imgen / Anonymous type with Expression.cs
Created August 31, 2021 06:20 — forked from leandromoh/Anonymous type with Expression.cs
Anonymous extension method that allow create a new instance of anonymous with new values, similar to with expression of records in C# and F#
public static class AnonymousExtension
{
static void Main(string[] args)
{
var person = new { FirstName = "Scott", LastName = "Hunter", Sex = 'M', Age = 25 };
var otherPerson = person.With(new { LastName = "Hanselman" });
Console.WriteLine(otherPerson);
}
@imgen
imgen / boxstarter.ps1
Created November 30, 2018 09:22
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Alex Ho
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>