Skip to content

Instantly share code, notes, and snippets.

naile / RedisBloomExtensions.cs
Last active January 21, 2022 05:05
Extension methods for using RedisBloom module with StackExchange.Redis
View RedisBloomExtensions.cs
public static class RedisBloomExtensions
public static async Task BloomReserveAsync(this IDatabaseAsync db, RedisKey key, double errorRate, int initialCapacity)
=> await db.ExecuteAsync("BF.RESERVE", key, errorRate, initialCapacity);
public static async Task<bool> BloomAddAsync(this IDatabaseAsync db, RedisKey key, RedisValue value)
=> (bool)await db.ExecuteAsync("BF.ADD", key, value);
public static async Task<bool[]> BloomAddAsync(this IDatabaseAsync db, RedisKey key, IEnumerable<RedisValue> values)
=> (bool[])await db.ExecuteAsync("BF.MADD", values.Cast<object>().Prepend(key).ToArray());

Keybase proof

I hereby claim:

  • I am naile on github.
  • I am naile ( on keybase.
  • I have a public key whose fingerprint is E7E5 540F B32C 9FA2 5C3E 1FCF 61C2 A08D 3F50 3619

To claim this, I am signing this object:

naile / search.js
Created February 3, 2019 20:55
View search.js
//vanilla js version of
var lunrIndex,
// Initialize lunrjs using our generated index file
function initLunr() {
var request = new XMLHttpRequest();'GET', 'js/lunr/index.json', true);
naile / ConfigureIoThreads.cs
Last active March 19, 2018 12:39
set dotnet IOCP/worker threads for Redis
View ConfigureIoThreads.cs
public static class ConfigureIoThreads
private static int IOCPThreadsMin = Environment.ProcessorCount * 4;
private static int WorkerThreadsMin = Environment.ProcessorCount * 2;
public static void ForRedis(ILogger logger)
// get the current settings.
ThreadPool.GetMinThreads(out int currentMinWorker, out int currentMinIOC);
naile / ApplicationInsightsFilter.cs
Created August 24, 2017 12:32
Application Insights Telemetry ignore statuscodes for specific operations
View ApplicationInsightsFilter.cs
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
using System.Linq;
namespace AppInsightsFilter
public class ApplicationInsightsFilter : ITelemetryProcessor
private ITelemetryProcessor Next { get; set; }