Instantly share code, notes, and snippets.

View ReferenceQueue.cs
public class PhantomReference
{
private readonly ReferenceQueue _queue;
protected PhantomReference(ReferenceQueue queue)
{
_queue = queue;
}
~PhantomReference()
View StringBuffer.cs
public class StringBuffer
{
private Queue<string> _buffer = new Queue<string>();
private int _offset;
public int Length;
public void Append(string content)
{
View Trivia.cs
public class Foo : BaseClass { }
public class Bar : BaseClass
{
public Bar() : base() { }
}
public class BaseClass
{
public BaseClass([CallerMemberName] string val = "Foo")
View StringBuffer.cs
/*
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, with no condition.
*/
View WebServer.cs
/// ProcessRequest is called for every new request
public void ProcessRequest()
{
DoSomethingAsync().Wait();
}
View Program.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Starvation
{
class Program
{
static void Main(string[] args)
{
View Program.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Starvation
{
class Program
{
static void Main(string[] args)
{
View Program.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Starvation
{
class Program
{
static void Main(string[] args)
{
View Program.cs
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Starvation
{
class Program
{
static void Main(string[] args)
{
View Runner.cs
[DllExport("compileandrun")]
public static void Script(IntPtr client, [MarshalAs(UnmanagedType.LPStr)] string args)
{
if (!InitApi(client))
{
return;
}
try
{