In-app billing with Google Play

Google Play Billing enables selling digital content and subscriptions. I integrate the Play Billing Library and initialize BillingClient with PurchasesUpdatedListener. Query available products with queryProductDetailsAsync(). Launch purchase flow with

Panic recovery middleware for HTTP servers

Even in Go, panics happen: a nil pointer in an edge case, a bad slice index, or a library bug. I don't want a single request to take down the whole process, so I wrap handlers with a recovery middleware that captures panics, logs them with request con

Feature flags for gradual rollouts

Feature flags (feature toggles) enable/disable functionality without code deployment. I use libraries like Togglz or FF4J for flag management. Flags support A/B testing, canary releases, and emergency kill switches. Strategy pattern determines flag st

tokio::select! for racing multiple async operations

Tokio's select! macro lets you wait on multiple futures simultaneously, proceeding with the first one that completes. I use it for timeouts, graceful shutdown, and racing I/O operations. Each branch is a pattern match on the future's output. If multip

Batch processing with Spring Batch

Spring Batch handles large-scale batch processing—ETL, data migration, report generation. Jobs contain steps; steps have readers, processors, and writers. Chunk-oriented processing reads, processes, and writes data in configurable batches. ItemReader

ActiveStorage for file uploads

ActiveStorage provides a unified interface for uploading files to cloud storage services like S3, GCS, or Azure Storage. I configure storage services in config/storage.yml and attach files to models using has_one_attached or has_many_attached macros.

CORS configuration for cross-origin requests

CORS (Cross-Origin Resource Sharing) controls which domains can access APIs. Browsers enforce same-origin policy by default. I configure allowed origins, methods, headers, and credentials. @CrossOrigin enables CORS per controller or method. Global con

Custom ViewGroup for advanced layouts

Custom ViewGroups enable specialized layout behavior beyond standard containers. I extend ViewGroup and override onMeasure() to measure children and onLayout() to position them. measureChild() or measureChildWithMargins() determines child sizes. Layou

Keep Controllers Thin: Use Command Objects

Command objects (a.k.a. “actions”) make controllers boring. They’re easy to test, easy to instrument, and they produce a stable API for the rest of your app. This is the kind of structure that makes large Rails apps maintainable.

Robfig cron jobs with context cancellation and jitter

Scheduled jobs get risky when deploys overlap or when jobs take longer than their interval. I use robfig/cron with a wrapper that creates a per-run context.WithTimeout, adds a bit of jitter to avoid synchronized load across instances, and logs start/f

Kubernetes RBAC and service account security

Kubernetes RBAC (Role-Based Access Control) restricts cluster access by user, group, or service account. Roles define permissions within a single namespace using rules with apiGroups, resources, and verbs. ClusterRoles apply cluster-wide. RoleBindings

CORS configuration for Rails APIs

Cross-Origin Resource Sharing (CORS) allows browsers to make requests from React apps hosted on different domains than the Rails API. The rack-cors gem configures CORS middleware with fine-grained control over origins, methods, and headers. In develop