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
//taken from https://github.com/tomsmeding/circular-buffer/blob/master/index.js and modified | |
//new features: | |
//find() | |
//getKeys() | |
//getValues() | |
//Persistant Buffer new features | |
//find() - finds a value by key | |
//getKeys() - gets only the keys available | |
//getValues() - gets the values | |
//load() - loads a buffer for use (useful if coming from server or localstorage) |
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
generateSortFn(props) { | |
return function (a, b) { | |
for (var i = 0; i < props.length; i++) { | |
var prop = props[i]; | |
var name = prop.name; | |
var reverse = prop.reverse; | |
if (a[name] < b[name]) | |
return reverse ? 1 : -1; | |
if (a[name] > b[name]) | |
return reverse ? -1 : 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
using System.Security.Claims; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Moq; | |
namespace Infrastructure.Testing.Builders | |
{ | |
public class BuilderResult : HttpContextBuilderResult | |
{ |
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 ColumnTypes | |
{ | |
public const int STRING = 12; | |
public const int BOOL = -7; | |
public const int TIMESTAMP = 93; | |
} |
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 ObfuscatorConverter : JsonConverter | |
{ | |
private readonly IEnumerable<Type> _types; | |
private readonly int _charsToShow; | |
private readonly char _obfuscateChar; | |
public ObfuscatorConverter() : this(2, '*') | |
{ | |
} |
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
// we use this to group them all as available based on already using this namespace | |
namespace Common.Extensions | |
{ | |
/// <summary> | |
/// adapted from https://archive.ph/2022.10.14-213608/https://betterprogramming.pub/my-top-7-custom-extension-methods-for-net-7-and-c-494acb2e6634#selection-1935.0-2339.1 | |
/// </summary> | |
public static class TaskExtensions | |
{ | |
/// <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
using System.Reflection; | |
namespace Entities | |
{ | |
public class PropertyMap<T> | |
{ | |
public Func<T, object> Getter { get; set; } | |
public PropertyInfo PropertyInfo { get; set; } |
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
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { Write-Host "Removing $($_.fullname)"; remove-item $_.fullname -Force -Recurse }; Write-Host "Complete" |
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
foreach (var item in spec.WhereExpressions) | |
{ | |
var sqlVisitor = new ExportsAPI.Domain.Visitors.SqlSearchExpressionVisitor(); | |
string sqlString = sqlVisitor.VisitExpression(item.Filter, test); | |
sql.Add(sqlString); | |
} | |
SQL list: | |
[0]: "(Assigned.UserName = 'Awesome')" | |
[1]: "(Id = 'fb9244e7-72d5-4842-95a2-7b44af136a9c')" | |
[2]: "(ClientId = 'fb9244e7-72d5-4842-95a2-7b44af136a9c')" |
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 CommentHelperTests: IClassFixture<TestFixture> | |
{ | |
private readonly TestFixture fixture; | |
public CommentHelperTests(TestFixture fixture, ITestOutputHelper output) | |
{ | |
this.fixture = fixture; | |
this.fixture.Initialize(output); | |
} |
OlderNewer