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
/* | |
* MIT License | |
* | |
* Copyright (c) 2023 James Woodall ([email protected]) | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
const compare = (a, b) => { | |
// 1. Split by `.` | |
const splitA = a.split('.'); | |
const splitB = b.split('.'); | |
// 2. Inner Compare function for each conmponent | |
const _cmp = (an, bn) => (an < bn ? -1 : an > bn ? 1 : 0); | |
const maxLoop = Math.max(splitA.length, splitB.length); |
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
/** | |
MIT License | |
Copyright (c) 2021, James Woodall | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
import { Component, EventEmitter } from '@angular/core'; | |
import { of, Observable, interval, merge, from, BehaviorSubject } from 'rxjs'; | |
import { switchMap, map, switchMapTo, delayWhen, filter, delay, tap, take, shareReplay, catchError } from 'rxjs/operators'; | |
import { HttpClient } from '@angular/common/http'; | |
const rngUrl = "https://www.random.org/integers/?num=1&min=1&max=6000&col=1&base=10&format=plain&rnd=new"; | |
@Component({ | |
selector: 'app-root', | |
template: ` |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
<RootNamespace>workflow_uploader</RootNamespace> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Newtonsoft.json" Version="12.0.3" /> |
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 ExtendedRedisCacheHandle : CacheManager.Redis.RedisCacheHandle<string> | |
{ | |
private const string BaseRegion = "Base"; | |
private readonly string _extraRegionName; | |
public ExtendedRedisCacheHandle(ICacheManagerConfiguration managerConfiguration, CacheHandleConfiguration configuration, | |
ILoggerFactory loggerFactory, ICacheSerializer serializer) | |
: base(managerConfiguration, configuration, loggerFactory, serializer) | |
{ |
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 static class MongoClientExtensions | |
{ | |
/// <summary> | |
/// Evaluates the specified javascript within a MongoDb database | |
/// </summary> | |
/// <param name="database">MongoDb Database to execute the javascript</param> | |
/// <param name="javascript">Javascript to execute</param> | |
/// <returns>A BsonValue result</returns> | |
public static async Task<BsonValue> EvalAsync(this IMongoDatabase database, string javascript) | |
{ |