Skip to content

Instantly share code, notes, and snippets.

View Liminiens's full-sized avatar
🏠
Working from home

Vlad Khapin Liminiens

🏠
Working from home
View GitHub Profile
module Program
open System.Collections.Generic
open BenchmarkDotNet.Attributes
open BenchmarkDotNet.Running
[<SimpleJob(launchCount = 3, warmupCount = 3, targetCount = 5)>]
[<GcServer(true)>]
[<MemoryDiagnoser>]
[<MarkdownExporterAttribute.GitHub>]
internal static class Program
{
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceFrequency(out long lpFrequency);
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceCounter(out long lpPerformanceCount);
private static void Main(string[] args)
{
long frequency, start, stop;
public static class UntypedOrderBy
{
private static readonly ConcurrentDictionary<(Type, string), Delegate> Lambdas = new ConcurrentDictionary<(Type, string), Delegate>();
public static IEnumerable<TType> OrderyByProperty<TType>(this IEnumerable<TType> collection, string name)
{
var lambda = Lambdas.GetOrAdd((typeof(TType), name), key =>
{
ParameterExpression entity = Expression.Parameter(typeof(TType));
MethodCallExpression getterCall =
var temp = new StringBuilder().Append("inter").Append("ned");
string internedString1 = temp.ToString();
string internedString2 = temp.ToString();
Console.WriteLine($"Interned? {nameof(internedString1)}: {String.IsInterned(internedString1) != null}");
Console.WriteLine($"Interned?: {nameof(internedString2)} {String.IsInterned(internedString2) != null}");
String.Intern(internedString1);
Console.WriteLine($"Interned? {nameof(internedString1)}: {String.IsInterned(internedString1) != null}");
@Liminiens
Liminiens / Dockerfile
Last active April 17, 2018 20:34 — forked from longkai/Dockerfile
shadowsocks-libev with simple obfs in a single docker image
#
# Dockerfile for shadowsocks-libev
#
FROM alpine
MAINTAINER longkai <i@xiaolongtongxue.com>
ENV SERVER_ADDR 0.0.0.0
ENV SERVER_PORT 8388
ENV PASSWORD=
/*подключить можно через Stylish для хрома с указанием доменов habrahabr.ru и geektimes.ru */
body {
font-family: sans-serif; /* Заменяет "system stack fonts" на обычный sans-serif. По крайней мере на вин10 это стало более читаемым */
}
.comment > .comment__message, .post__text-html{
line-height: 150%; /* 1.6 -> 1.5 */
}
Total time: 00:03:10 (190.47 sec)
// * Summary *
BenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 2 (10.0.15063)
Processor=Intel Core i5-4670 CPU 3.40GHz (Haswell), ProcessorCount=4
Frequency=3320320 Hz, Resolution=301.1758 ns, Timer=TSC
[Host] : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2101.1
DefaultJob : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2101.1