This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"a": { | |
"b": { | |
"c": { | |
"d": 43 | |
} | |
} | |
}, | |
"f": "hello" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Start-Rider([string] $sln) { | |
& "C:\Users\george.kinsman\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\JetBrains Toolbox\Rider.lnk" $sln | |
} | |
Set-Alias -Name rider -Value Start-Rider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExceptionFingerprintEnricher : ILogEventEnricher | |
{ | |
private const string ThumbprintKey = "ExceptionThumbprint"; | |
private const string TypeKey = "ExceptionType"; | |
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) | |
{ | |
if (logEvent.Exception == null) return; | |
var fingerprint = ExceptionFingerPrinter.GetFingerprint(logEvent.Exception); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IResult | |
{ | |
bool WasSuccessful { get; } | |
string[] Errors { get; } | |
bool WasFailure { get; } | |
} | |
public class Result : IResult | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var busControl = Bus.Factory.CreateUsingRabbitMq(cfg => { | |
cfg.UseLog4Net(); | |
cfg.UseApplicationInsights(_telemetryClient); | |
cfg.PrefetchCount = (ushort)_settings.MessageBusPrefetchCount; // 10 in our config | |
host = cfg.Host("rabbitcluster", config.VHost, h => { | |
h.UseCluster(c => prioritisedHostNames.ForEach(c.Node)); | |
h.Username(_shardConfigProvider.Username); | |
h.Password(_shardConfigProvider.Password); | |
h.PublisherConfirmation = _publisherConfirms; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class UnhandledExceptionLogger | |
{ | |
public static void Install() | |
{ | |
var log = Log.ForContext(typeof(UnhandledExceptionLogger)); | |
AppDomain.CurrentDomain.UnhandledException += (s, e) => | |
{ | |
log.Fatal(e.ExceptionObject as Exception, "Unhandled exception caught at AppDomain boundary (terminating: {IsTerminating})", e.IsTerminating); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {customAttribute} from 'aurelia-framework'; | |
import {autoinject} from 'aurelia-framework'; | |
import * as $ from "jquery"; | |
@autoinject | |
@customAttribute('found') | |
export class FoundationCustomAttribute { | |
constructor(private element: Element) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EnumerableOfStringParser : IValueParser | |
{ | |
private readonly string _separator; | |
public EnumerableOfStringParser(string separator = null) | |
{ | |
_separator = separator; | |
} | |
public bool CanParse(Type settingValueType) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace SemitoneCalculator | |
{ | |
public static class ToneExtensions | |
{ | |
public static Tone Up(this Tone tone) | |
{ | |
return tone.Name == ToneName.B | |
? new Tone(ToneName.C, tone.Octave + 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*@ | |
Note that this is directly from his blog post on https://github.com/tpetricek/TomaspNet.Website/blob/master/source/blog/2013/tuples-in-csharp.fsx | |
The only minor addition is on L162: | |
yield [ for p in meth.GetParameters() -> p.ParameterType.ToString() + ": " + p.Name ] } | |
where we added the name of the parameter in the key for the grouping. Results are interesting! | |
Also added a Dump on L180 for LinqPad :) | |
*) |
NewerOlder