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
// Configure binding provider for MVC during the general setup, e.g. | |
// ... AreaRegistration.RegisterAllAreas(); | |
ModelBinderProviders.BinderProviders.Add(new MyProject.ModelBinders.Mvc.ShortGuidModelBinderProvider()); | |
// ... FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); |
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; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Text; | |
namespace TarExample | |
{ | |
public class Tar | |
{ | |
/// <summary> |
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
param($work) | |
# restart PowerShell with -noexit, the same script, and 1 | |
if (!$work) { | |
powershell -noexit -file $MyInvocation.MyCommand.Path 1 | |
return | |
} | |
# source: | |
# https://michael-mckenna.com/update-multiple-git-repositories-on-windows-at-once-using-powershell/ |
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
// This needs to be injected into swagger-ui's index.html file after 'swagger-ui.js' (where getMockSignature is defined) | |
// but _before_ it is used to render parts of the page. A horrible dirty hack. | |
var _originalGetMockSignature = window.Model.prototype.getMockSignature; | |
window.Model.prototype.getMockSignature = function newModelGetMockSignature(modelsToIgnore) { | |
var model = this; | |
var signature = _originalGetMockSignature.apply(this, arguments); |
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 DistinguishedName | |
{ | |
/// <summary> | |
/// Represents a name/value pair within a distinguished name, including the index of the part. | |
/// </summary> | |
public struct Part | |
{ | |
public Part(string name, string value, int index = -1) | |
: this() | |
{ |
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 () { | |
var re_leading_whitespace = /^\s+(?=[^\s])/g, | |
re_is_whitespace = /^\s*$/, | |
re_br = /<br ?\/?>/gi, | |
re_blockquotes_for_html_fix = /^(\s*>)+/gm; | |
function transform_markdown(html, text) { | |
var | |
// leading padding string, if found |
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
// vars to be used inside column value funcs | |
DateTime utcnow = DateTime.UtcNow; | |
const decimal VIP_SPEND = 1000000M; | |
var fields = new CsvDefinition<MyRecord> | |
{ | |
{ "Username", row => string.Concat(row.Prefix, ":", row.Username) }, | |
{ "Email", row => row.Email }, | |
{ "Status", row => row.TotalSpend >= VIP_SPEND ? "VIP" : "Pffft..., Peon" }, | |
{ "Spend ($)", row => row.TotalSpend == null ? "None" : row.TotalSpend.ToString("n2") }, |