Skip to content

Instantly share code, notes, and snippets.

View jaredpar's full-sized avatar

Jared Parsons jaredpar

View GitHub Profile
@jaredpar
jaredpar / dockerfile
Last active February 3, 2021 20:12
Roslyn CI Dockerfile
# escape=`
FROM mcr.microsoft.com/windows/servercore:10.0.19042.746-amd64
ENV `
GIT_SHA=dc05143487a23b10b1c4c87a0c55aa69c7451386
# Use PowerShell as the default shell
SHELL ["powershell", "-command"]
@jaredpar
jaredpar / is-reproducible.cs
Created January 13, 2021 22:32
Program to check if files were compiled with the determinism flag
using System;
using System.IO;
using System.Linq;
using System.Reflection.PortableExecutable;
foreach (var filePath in args)
{
using var stream = File.OpenRead(filePath);
var peReader = new PEReader(stream);
var any = peReader.ReadDebugDirectory().Any(x => x.Type == DebugDirectoryEntryType.Reproducible);
@jaredpar
jaredpar / StrangeLoop.cs
Created January 8, 2021 20:43
Immo said my infinite loop wasn't creative enough so ha!
using System;
using System.Reflection;
namespace ChallengeAccepted
{
class Program
{
static void Main(string[] args)
{
var ca = new ChallengeAccepted();
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.Linq;
var code = @"
using System;
#nullable enable
{
"profiles": {
"R9LoggingGenerator": {
"commandName": "Executable",
"executablePath": "C:\\Program Files\\dotnet\\dotnet.exe ",
"commandLineArgs": "exec \"C:\\Program Files\\dotnet\\sdk\\5.0.100\\Roslyn\\bincore\\csc.dll\" /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702 /fullpaths /nostdlib+ /errorreport:prompt /warn:5 /define:TRACE;DEBUG;NET;NET5_0;NETCOREAPP /preferreduilang:en-US /highentropyva+ /nullable:enable /reference:\"C:\\Program Files\\dotnet\\packs\\Microsoft.NETCore.App.Ref\\5.0.0\\ref\\net5.0\\Microsoft.CSharp.dll\" /reference:p:\\nuget\\microsoft.extensions.dependencyinjection.abstractions\\5.0.0\\lib\\netstandard2.0\\Microsoft.Extensions.DependencyInjection.Abstractions.dll /reference:p:\\nuget\\microsoft.extensions.dependencyinjection\\5.0.0\\lib\\net5.0\\Microsoft.Extensions.DependencyInjection.dll /reference:p:\\nuget\\microsoft.extensions.logging.abstractions\\5.0.0\\lib\\netstandard2.0\\Microsoft.Extensions.Logging.Abstractions.dll /reference:p:\\nuget\\m
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using System;
class Program
{
static void Main(string[] args)
{
var compilation = CSharpCompilation.Create(
"example.dll",
@jaredpar
jaredpar / blah.md
Last active October 28, 2020 12:17
Build Kind Start Time
0 Rolling 2020-10-01
1 Rolling 2020-10-02
2 Rolling 2020-10-03
3 Rolling 2020-10-04
4 Rolling 2020-10-05
857678 is missing
===
Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeRefactorings.InlineTemporary.InlineTemporaryTests.TestWithLinkedFile
Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen.CodeGenAsyncIteratorTests.TryFinally_AwaitUsingInCatch(iterations: 2, expectedOutput: \"1 Throw Caught Throw2 Dispose CAUGHT DISPOSAL DONE\")
Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen.CodeGenAsyncIteratorTests.TryFinally_DisposeIAsyncEnumeratorMethod(iterations: 2, expectedOutput: \"1 Break Throw Caught Finally END DISPOSAL DONE\")
Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen.CodeGenAsyncIteratorTests.TryFinally_YieldBreakInDisposeMode(iterations: 2, expectedOutput: \"1 Break Throw Caught Finally END DISPOSAL DONE\")
Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen.CodeGenAsyncIteratorTests.TryFinally_AwaitForeachInCatch(iterations: 1, expectedOutput: \"Try Item1 Item2 Throw1 Finally Item1 Item2 Throw2 \"...)
Microsoft.CodeAnalysis.CSharp.UnitTests.Semantics.NullableReferenceTypesTests.CompareExchange_LocationNullS