This file contains hidden or 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; | |
using System.Runtime.CompilerServices; | |
using JetBrains.Annotations; | |
// Reduced-down and slightly refactored version of https://gist.github.com/LordJZ/92b7decebe52178a445a0b82f63e585a | |
// It exposes only (T separator) overload of the Split method which was enough for my needs. | |
public static class SpanExtensions | |
{ | |
public readonly ref struct Enumerable<T> | |
where T : IEquatable<T> |
This file contains hidden or 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
// Copyright (C) 2019 Dmitry Yakimenko ([email protected]). | |
// Licensed under the terms of the MIT license. See LICENCE for details. | |
using System; | |
using System.IO; | |
using System.Linq; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CSharp; | |
using Microsoft.CodeAnalysis.CSharp.Syntax; |
This file contains hidden or 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; | |
using System.Diagnostics.Contracts; | |
using System.Runtime.CompilerServices; | |
public static class SpanSplitExtensions | |
{ | |
public ref struct Enumerable1<T> where T : IEquatable<T> | |
{ | |
public Enumerable1(ReadOnlySpan<T> span, T separator) | |
{ |
This file contains hidden or 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 e = document.createElement('div'); | |
e.innerHTML = Array.from(document.body.querySelectorAll('a[href^="https://steamcommunity.com/market/confirmlisting/"]')) | |
.filter(e => e.href.indexOf('cancel') < 0) | |
.map(e => '<a href="'+e.href+'" onclick="p=this.parentNode;p.removeChild(this.nextElementSibling);p.removeChild(this);if(!p.children.length)p.parentNode.removeChild(p);">'+e.href+'</a><br>') | |
.join('\n'); | |
document.body.appendChild(e); | |
e.style.position = 'absolute'; | |
e.style.top = 0; | |
e.style.backgroundColor='white'; | |
e.style.border='1px solid black'; |
This file contains hidden or 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 LogRequestModule : Module | |
{ | |
public int depth = 0; | |
protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, | |
IComponentRegistration registration) | |
{ | |
registration.Preparing += RegistrationOnPreparing; | |
registration.Activating += RegistrationOnActivating; | |
//registration.Activated += RegistrationOnActivated; |
This file contains hidden or 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
[HttpPost] | |
public HttpResponseMessage CreateCustomer(string name, string billingInfo) | |
{ | |
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo); | |
Result<CustomerName> customerNameResult = CustomerName.Create(name); | |
return Result.Combine(billingInfoResult, customerNameResult) | |
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value)) | |
.OnSuccess(() => new Customer(customerNameResult.Value)) | |
.OnSuccess( |
#Transform web.config on build
- Unload the project
- Edit .csproj
- Append figure 1 to the end of the file just before
</Project>
; v12.0 my change depending on your version of Visual Studio - Save .csproj and reload
- Open configuration manager
- Add a new Configuration Name: Base. Copy settings from: Release
- Copy the contents of your web.config
- Right click Web.Config > Add Config Transformation
This file contains hidden or 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; | |
using System.Collections.Generic; | |
using System.Dynamic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace statsd.net.shared | |
{ | |
public class BetterExpando : DynamicObject |
This file contains hidden or 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
<%@ WebHandler Language="C#" Class="PassThruProxy" Debug="true" %> | |
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Text; | |
using System.Web; | |
/** | |
* <summary><c>PassThruProxy</c> is a simple pass-through proxy interface for C#.NET (IIS Servers).</summary> |
NewerOlder