Skip to content

Instantly share code, notes, and snippets.

View Meir017's full-sized avatar
🎯
Focusing

Meir Blachman Meir017

🎯
Focusing
View GitHub Profile
@Meir017
Meir017 / orleans-credentials-cache-single-file.cs
Created September 8, 2025 20:09
Orleans Multi-Tenant Credentials Cache - Complete Single File Application This is a complete Orleans application demonstrating multi-tenant credential caching in a single C# file. Features: - Orleans 9.2.1 with localhost clustering - Multi-tenant credential isolation using IGrainWithStringKey - Azure.Identity integration with automatic MSAL toke…
// Orleans Credentials Cache - Single File Application
// This demonstrates a complete Orleans multi-tenant credentials cache application in a single .cs file
//
// To run: dotnet run orleans-cache.cs
// To publish as single-file executable: dotnet publish -c Release -r win-x64 -p:PublishSingleFile=true
//
// This single file contains:
// - Orleans host configuration
// - Grain interfaces and implementations
// - Azure.Identity integration with built-in caching
@Meir017
Meir017 / AppHost.cs
Created September 4, 2025 04:54
aspire vibed interaction service usage
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Aspire.Hosting;
#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
var builder = DistributedApplication.CreateBuilder(args);
var apiService = builder.AddProject<Projects.lcnc_aspire_demo_ApiService>("apiservice")
.WithHttpHealthCheck("/health")
@Meir017
Meir017 / Program.cs
Last active April 9, 2025 19:38
Analyze the LoggerMessage usages in a project
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace dotnet_ideas;
public class Program
{
@Meir017
Meir017 / Program.cs
Last active October 27, 2024 06:29
Sharpliner.generator
using System.CodeDom.Compiler;
using System.Text;
using System.Text.Json;
using Json.Schema;
var rawSchemaJson = await File.ReadAllTextAsync("yamlschema.json");
var jsonSchema = JsonSerializer.Deserialize<JsonSchema>(rawSchemaJson) ?? throw new InvalidOperationException("Failed to deserialize schema");
var definitions = jsonSchema.GetDefinitions() ?? throw new InvalidOperationException("Failed to get definitions");
var taskDefinition = definitions["task"]!;
@Meir017
Meir017 / EnumsSourceGenerator.cs
Created August 7, 2024 17:48
source generator for Garnet Enums
using System.Text;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace dotnet_analyzer_ideas;
[Generator]
public class EnumsSourceGenerator : ISourceGenerator
{
@Meir017
Meir017 / docker-downloader.ps1
Created January 23, 2024 20:44
download docker images to TAR files
function download-docker-image {
param(
[Parameter(Mandatory=$true)]
[string]$image,
[Parameter(Mandatory=$true)]
[string]$tag,
[Parameter(Mandatory=$true)]
[string]$output
@Meir017
Meir017 / download-docker-image.ps1
Last active November 17, 2023 11:20
Download Docker Image powershell
param(
[Parameter(Mandatory = $true)]
[string]$ImageName,
[string]$Tag = 'latest',
[ValidateSet(
'DockerIO',
'Microsoft'
)]
[string]$Registry = 'DockerIO'
)
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal
ARG PLAYWRIGHT_VERSION
# === INSTALL dependencies ===
RUN apt-get update && \
# Feature-parity with node.js base images.
apt-get install -y --no-install-recommends git openssh-client curl && \
# clean apt cache
@Meir017
Meir017 / metadata.md
Last active October 11, 2023 14:58
google chrome debian 97

Google Chrome version - 97.0.4692.99-1 base position - 938553

websites:

@Meir017
Meir017 / package-lock.json
Last active May 8, 2022 19:22
node-tgz-downloader #19 package.lock
{
"name": "hello-world",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "hello-world",
"version": "0.1.0",
"dependencies": {