Skip to content

Instantly share code, notes, and snippets.

View samuelj90's full-sized avatar
πŸ˜ƒ
Enter your status

SAMUEL J MATHEW samuelj90

πŸ˜ƒ
Enter your status
View GitHub Profile
@samuelj90
samuelj90 / event_broker.ts
Created November 8, 2026 14:55
Micro-Frontend DOM CustomEvent Broker Pattern
// Decoupled CustomEvent DOM Event Broker for Micro-Frontends
export interface PortalSessionEventDetail {
authenticated: boolean;
tenantId: string;
userRole: 'ADMIN' | 'ENGINEER' | 'VIEWER';
timestamp: number;
}
export class MicroFrontendBroker {
private static readonly TOPIC = 'portal:session:updated';
@samuelj90
samuelj90 / harness_hook.sh
Last active November 9, 2026 03:25
Three-Loop AI Harness: Zero-Token Pre-Commit Quality Gate
#!/bin/bash
# Pre-commit zero-token quality gate enforcing conventional commits and clean author state
set -euo pipefail
# 1. Author identity verification
EXPECTED_EMAIL="email@gmail.com"
AUTHOR_EMAIL=$(git config user.email)
if [ "$AUTHOR_EMAIL" != "$EXPECTED_EMAIL" ]; then
echo "❌ [HARNESS GATE] Invalid commit author email: $AUTHOR_EMAIL"
@samuelj90
samuelj90 / idempotent_consumer.java
Created November 8, 2026 14:53
Spring Boot 3 Idempotent Kafka Consumer Pattern
// Idempotent Kafka Consumer with Distributed Cache Deduplication
@Component
public class PaymentEventListener {
private final RedisTemplate<String, String> redisTemplate;
private final PaymentLedgerService ledgerService;
private static final Duration DEDUPLICATION_TTL = Duration.ofDays(7);
public PaymentEventListener(RedisTemplate<String, String> redisTemplate,
PaymentLedgerService ledgerService) {
@samuelj90
samuelj90 / outbox_example.java
Created November 8, 2026 14:53
Spring Boot 3 Transactional Outbox Pattern
// Transactional Outbox Pattern: Atomic Order Persistence & Outbox Event Insertion
@Service
@Transactional
public class OrderService {
private final OrderRepository orderRepository;
private final OutboxEventRepository outboxRepository;
private final ObjectMapper objectMapper;
public OrderService(OrderRepository orderRepository,
@samuelj90
samuelj90 / RancherDesktopSetup.md
Last active August 2, 2025 19:07
Setup Rancher Desktop without admin rights

Setup Rancher Desktop without admin rights

Setup

  1. Install WSL from Microsoft Store

  2. Update to WSL2

wsl --install