Skip to content

Instantly share code, notes, and snippets.

View MirzaLeka's full-sized avatar
:octocat:

Mirza Leka MirzaLeka

:octocat:
View GitHub Profile
@MirzaLeka
MirzaLeka / disable-sentry.md
Last active November 11, 2025 08:46
Disable Sentry in development environment (or any other env) using Next.js/Node.js

Disable Sentry in development environment (or any other)

Look for Sentry config file/s (sentry.client.js & sentry.config.js)

Either file should contain an object like this

Sentry.init({
  dsn: DSN_YOU_ACQUIRED_FROM_SENTRY
})
@MirzaLeka
MirzaLeka / Program.cs
Last active September 7, 2025 23:33
Dummy integration tests c#
using TestingPractice.Services;
namespace TestingPractice
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
@MirzaLeka
MirzaLeka / IOrderService.cs
Last active July 17, 2025 15:01
ASP .NET Worker Service for Apache ActiveMQ
namespace AMQSubscriberWorker.Services
{
public interface IOrderService
{
PizzaOrder? DeserializeOrder(string pizzaOrder);
}
}
using APIDocsRider.DB;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
namespace APIDocsRider.BL;
public class WorkerService(ILogger<WorkerService> logger, IServiceProvider serviceProvider) : BackgroundService
{
private readonly IServiceProvider _serviceProvider = serviceProvider;
private readonly ILogger<WorkerService> _logger = logger;

To log into SQL Server using Serilog and store logs in your custom logs table, follow these steps:


1. Install Required Packages

Ensure you have the necessary Serilog packages installed via NuGet:

Install-Package Serilog
Install-Package Serilog.Sinks.MSSqlServer
@MirzaLeka
MirzaLeka / app-structure.md
Last active April 27, 2025 13:05
HTML & JS Push Notifications

Project Info

This example demonstrates how to handle browser push notifications using vanilla HTML & JavaScript via Web Push API. WebPush API sends messages from the server (backend) to the client (browser/mobile phone). The API uses HTTP2 protocol which requires HTTPS connection (unless you're in localhost) The server sends messages to the client's browser via Firebase Cloud Messaging API (or FCM for short).

Prerequisites

  • You need to obtain the public VAPID key to be able to connect to the server. Look up generate-VAPID-key.md file.
  • Make sure Backend server uses the same VAPID keys.
@MirzaLeka
MirzaLeka / main.md
Last active April 23, 2025 19:39
.NET to Node.js Rabbit MQ Example

.NET to Node.js via Rabbit MQ

  • Sender: .NET 8
  • Receiver: Node.js
  • Protocol: AMQPS (secured AMQP)
  • RabbitMQ Host:: AWS (AMQ)

Package Versions

.NET

@MirzaLeka
MirzaLeka / aws-sqs-guide.md
Last active April 23, 2025 05:46
AWS SQS Guide

AWS SQS Guide

Amazon Simple Queue Service (SQS) lets you send, store, and receive messages between software components at any volume, without losing messages or requiring other services to be available.

Messages stored in SQS can be pulled out by other services such as EC2, Lambda, etc. Upon pulling, message is deleted from the queue.

image

@MirzaLeka
MirzaLeka / migrate-to-angular-18.md
Created September 14, 2024 18:41
Angular 18 Upgrade Guide

Angular 18 Upgrade Guide

Version before the update:

  • Angular: 17.3
  • Node.js: 18.8

Install Node.js LTS

  • Download Node.js 20.17.0
  • Install on the machine
@MirzaLeka
MirzaLeka / 0-init.md
Created October 11, 2024 13:52
Angular Reactive Form with Async Validations

Angular Reactive Forms with Validations & Async Validations