Skip to content

Instantly share code, notes, and snippets.

View lurongkai's full-sized avatar
🏠
rocking

Ron lurongkai

🏠
rocking
View GitHub Profile
// puzzle location: https://gist.github.com/JeffreyZhao/297760dcff8c066606e8
public class GodCaller : ICaller
{
public TResult Call<T, TResult>(T arg) {
var argWapper = ArgWapper.Create(arg);
var returnWapper = CallCore(argWapper);
return returnWapper.As<TResult>();
}
protected ArgWapper CallCore(ArgWapper arg) {

Powershell notes

Change Code Page: chcp 437

Refresh Group Policy three times and wait for five minutes between refreshes:

1..3 | % {gpupdate ; sleep 300}
@lurongkai
lurongkai / ThreadPoolHittingTest.cs
Last active December 19, 2015 21:19
ThreadPoolHittingTest
using System;
using System.Threading;
using System.Collections.Generic;
using System.Collections.Concurrent;
namespace ThreadPoolHittingTest
{
class MainClass
{
private static ConcurrentDictionary<int, Thread> ThreadDict = new ConcurrentDictionary<int, Thread>();
@lurongkai
lurongkai / csharp_extension_method.cs
Created August 3, 2012 11:36
C# extension method
public class TestClass
{
public int NormalProperty { get; private set; }
public void NormalMethod() {
Console.WriteLine("Normal Method.");
}
}
public static class TestExtension