Skip to content

Instantly share code, notes, and snippets.

@SaahilClaypool
SaahilClaypool / DapperConstructorSourceGenerator.cs
Created May 31, 2023 19:31
Dapper constructor source generator
global using Microsoft.CodeAnalysis;
global using Microsoft.CodeAnalysis.CSharp.Syntax;
using System.Diagnostics;
namespace Srcgen;
/// <summary>
/// Author: Saahil Claypool
/// https://github.com/dotnet/roslyn/blob/main/docs/features/incremental-generators.md
@hongymagic
hongymagic / Setup-WSL-Port-Forwarding.ps1
Created June 17, 2022 04:49
Windows 11 Forward ports to WSL 2 instance
<#
.Description
Setup-WSL-Port-Forwarding function forwards commonly used ports from host to WSL.
The forwarded ports include standard HTTP, HTTPS, Postgres, Redis and other development ports.
Run:
Setup-WSL-Port-Forwarding.ps1
#>
$PortsToForward = @(80, 443, 1025, 3000, 3001, 4444, 5000, 5900, 8025, 8080, 8081, 8888, 8900, 9090, 9091, 9190, 9191, 5432, 6379)
@andrewloable
andrewloable / Program.cs
Created June 23, 2019 05:48
Use a library compiled in Go in c# (.net)
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace GoSharedDLL
{
class Program
{
[DllImport("shared.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
private static extern IntPtr ReturnReversedString(byte[] input);
@indyfromoz
indyfromoz / aspnet-mvc.gitignore
Created November 19, 2012 06:44
.Gitignore for ASP.NET MVC
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache