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 / NestJS DI.md
Last active April 30, 2023 18:44
Nest.js Depdendency Inversion example

Nest.js Dependency Inversion with Abstract classes

The Motivation

In strictly typed object-oriented languages such as Java or C#, it's a common practice to invoke a method from a service by calling an interface as opposed to an actual service. This pattern is useful when swapping dependencies on the fly (like logging to the console or to the database) or unit testing, as we're not bounded to work with actual classes, but rather abstractions.

The Problem

@MirzaLeka
MirzaLeka / 1-introduction.md
Last active July 16, 2023 19:13
Angular Reactive Form

Using Local Storage with Observables in Angular

Key Files:

  • todo-form.module.ts
  • todo-form.component.ts
  • todo-form.component.html
  • local-storage.service.ts

EF Core Query All Paramaters that are not null

If you find yourself in a situation where you have multiple parameters where you can query:

  • by one param
  • combination of params
  • all params

And you want to execute just one DB call and avoid querying with params that are NULL, do the following:

@MirzaLeka
MirzaLeka / angular-form-validations.md
Last active July 18, 2023 19:27
Angular form input validaiton

Validations & Errors in Angular Reactive Forms

This document will teach you how to validate from control in Angular using Reactive Forms. Start by creating a simple form:

Step 1: Go to component module and import ReactiveFormsModule

@NgModule({
  declarations: [
@MirzaLeka
MirzaLeka / vba-array-of-obj.md
Created September 19, 2023 19:01
VBA array of objects

Array of Objects in VBA

Sub Button1_Click()

    Dim arr() As Object
    Dim data As Object
    
    ' Create the object
 Set data = CreateObject("Scripting.Dictionary")
@MirzaLeka
MirzaLeka / csharp-dynamic-response.md
Last active September 21, 2023 22:22
C# - Get Dynamic Response

Retrieve Dynamic Response in C#

Subclasses for different purposes:

class User {
	public string name;
  	public int age;
	public User() {
		this.name = "Mirza";
@MirzaLeka
MirzaLeka / http-client-nodejs.md
Last active December 30, 2023 22:09
Send, Receive Request and Handle Response in Node.js using HTTP module

HTTP Client in Node.js

Learn how to send a POST request using HTTP/S module in Node.js.

const http = require('http');

const user = {
  name: 'Super Mario',
 level: 94,

Upload the image with a preview using HTML, CSS & JavaScript

image

Photo by Helena Lopes from Pexels

Code below:

Angular Frontend & SSR Deployment on IIS

Videos

Angular Front

Deploy angular app to IIS - YouTube (Kudvenkat) https://www.youtube.com/watch?v=VkGmaVm6-IQ

Angular 15 deployment in IIS Server | Hosting angular in IIS Server | Nihira Techiees - YouTube