What benefits does this context provide, and how does it provide them?
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
<div class="card shadow-sm card-tab"> | |
<div class="card-body"> | |
<span> {{ activeTab.name }} {{ activeTab.index }} / {{tabs.length}} <button @click="previousTab($event)" type="button" class="btn btn-light"><</button> <button @click="nextTab($event)" type="button" class="btn btn-light"> ></button></span> | |
</div> | |
</div> | |
<div class="b-example-divider"></div> | |
<div class="card shadow-sm card-tab"> | |
<div class="card-body"> | |
<ul class="nav nav-pills nav-fill nav-flush flex-row mb-auto text-center" id="myTab" role="tablist"> | |
<li class="nav-item border-end" role="presentation" v-for="(tab, index) in tabs" :key="tab.id"> |
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
$( document ).ready(function() { | |
console.log( "ready!" ); | |
$("[class^='trigger_']").on('change', function () { | |
// Get CSS class list from the input parameter. Find the one with the 'trigger_' prefix, | |
// and use it to identify which 3D scene (iFrame) will be updated | |
var sceneName = null; | |
var $this = $(this); | |
console.log("clicked:") |
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 async IAsyncEnumerable<T> SearchAllWithParallelScrollAsStream<T>(this IElasticClient elasticClient, | |
Func<SearchDescriptor<T>, ISearchRequest> query, | |
int shardSize = 2, | |
Expression<Func<T, object>> routingPath = null, | |
[EnumeratorCancellation] CancellationToken cancellationToken = default, | |
string scrollTimeout = "2m", int scrollSize = 1000) where T : class | |
{ | |
shardSize = Math.Max(shardSize, 1); | |
var scrolls = new ConcurrentQueue<string>(); | |
var stream = elasticClient.ScrollAll<T>(scrollTimeout, shardSize, s => s |
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 EnumerableTplExtensions | |
{ | |
public static Task ForeachWithTpl<TSource>(this IEnumerable<TSource> source, | |
Action<TSource> action, | |
ExecutionDataflowBlockOptions options | |
) | |
{ | |
if (source == null) | |
{ | |
throw new ArgumentNullException(nameof(source)); |
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.Collections.Generic; | |
using System.Linq; | |
namespace [YOURNAMESPACEHERE] | |
{ | |
public static class TypeExtensions | |
{ | |
public static bool IsDerivingFrom(this Type type, Type searchType) |
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 ServiceCollectionExtensions | |
{ | |
public static IServiceCollection AddRedisDistributedLocker( this IServiceCollection serviceCollection,IDatabase database) | |
{ | |
serviceCollection. AddSingleton<IDistributedLocker>(sp=>new RedisDistributedLocker(database)); | |
return serviceCollection; | |
} | |
public static IServiceCollection AddRedisClientDistributedLocker( this IServiceCollection serviceCollection) | |
{ |
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 DistributedLock | |
: IAsyncDisposable | |
{ | |
private const string AtomicReleaseScript = @" | |
if redis.call(""get"",KEYS[1]) == ARGV[1] then | |
return redis.call(""del"",KEYS[1]) | |
else | |
return 0 | |
end | |
"; |
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.Collections.Generic; | |
using System.Linq; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
namespace XXX | |
{ | |
public static class SingletonExtensions | |
{ |
Regex to match numbers except numbers between quotes
-?\d+(.\d+)?(?=(([^"]*'){2})*[^"]*$)
NewerOlder