Skip to content

Instantly share code, notes, and snippets.

{
"test": "test"
}
@TheMulti0
TheMulti0 / CompositeContractResolver.cs
Created February 23, 2019 10:45
A JSON.NET Contract Resolver that supports multiple contract resolvers
public class CompositeContractResolver : IContractResolver, IEnumerable<IContractResolver>
{
private readonly IList<IContractResolver> _contractResolvers = new List<IContractResolver>();
public JsonContract ResolveContract(Type type)
{
return
_contractResolvers
.Select(x => x.ResolveContract(type))
.FirstOrDefault(Conditional.IsNotNull);
@TheMulti0
TheMulti0 / INotifyPropertyChangedBenchmark
Created February 16, 2019 09:47
A class that utilizes BenchmarkDotNet to check the speeds of the two approaches
[Benchmark]
public static void SetPropertiesOnClassic()
{
var myClassic = new ClassicClass();
myClassic.Meme = 42;
myClassic.Name = "Memetic";
}
[Benchmark]
public static void GetPropertiesOnClassic()
function search() {
if (location.href.indexOf("downloadmixcloud") != -1) {
location.href = "http://www.download-mixcloud.com#" + $("#track").val();
return
}
var seachUrl = $("#track").val();
var UI = $("#result").empty();
if (seachUrl == "") {
$("<div>Please enter the mixcloud song link</div>").appendTo(UI);
return
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using TuneDesktop.Models;
namespace TuneDesktop
@TheMulti0
TheMulti0 / NoteManager.cs
Last active November 19, 2018 18:48
Just a code reformat for XeZrunner
public class NoteManager
{
public string CreateNoteFileExtension(NoteColor color)
=> $".xesignnote_/*{color.ToString()}*/";
/// <summary>
/// AppDirectory\Configuration\...
/// </summary>
public string GetPathForNoteFile(string file)
{