Skip to content

Instantly share code, notes, and snippets.

😵
ღ(¯`◕‿◕´¯) ♫ ♪ ♫

ᎬᏁᎶᎥᏁᎬᎬᏒ he-dev

😵
ღ(¯`◕‿◕´¯) ♫ ♪ ♫
  • ƃǝɹɯɐnʎ, ɔoןoƃnǝ
Block or report user

Report or block he-dev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@he-dev
he-dev / SelectManyAsync.cs
Created Feb 15, 2019
SelectManyAsync test-case
View SelectManyAsync.cs
void Main()
{
var tasks = new[]
{
Task.FromResult(new [] {1, 2, 3}.Select(x => Task.FromResult(x))),
Task.FromResult(new [] {4, 5, 6}.Select(x => Task.FromResult(x))),
};
tasks.SelectManyAsync().Select(t => t.GetAwaiter().GetResult()).Dump();
}
View outT.cs
interface IRequest<out T>
{
T Create();
}
class WebRequest<T> : IRequest<T>
{
public virtual T Create() { return default; }
}
@he-dev
he-dev / DictionaryJsonConverter
Created Mar 27, 2018 — forked from petermorlion/DictionaryJsonConverter
Generic JsonConverter for JSON.NET and IDictionaries
View DictionaryJsonConverter
// UPDATE!
// In Json.NET 7, a DictionaryKeyResolver was added.
// This might be able to fix the problem more elegantly.
// I haven't checked though.
public class DictionaryJsonConverter : JsonConverter
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var dictionary = (IDictionary)value;
@he-dev
he-dev / repo-reset.md
Created Nov 19, 2017 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands
View repo-reset.md

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@he-dev
he-dev / repo-reset.md
Created Nov 19, 2017 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands
View repo-reset.md

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
View 161172.a.cs
using System;
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Attributes;
namespace Test {
public class PalindromNumber {
//Thanks to @Velial and @Denis
View custom.app.config.xml
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<PostBuildEvent>xcopy "$(ProjectDir)custom.app.config" "$(TargetDir)Application.config" /Y</PostBuildEvent>
</PropertyGroup>
You can’t perform that action at this time.