Skip to content

Instantly share code, notes, and snippets.

@prabh-62
prabh-62 / libraries.md
Created May 5, 2026 14:26
Put most code in class libraries (.NET)

.NET architecture: class libraries, entry points, and thin controllers

Put most code in class libraries so new hosts (API, worker, AI, mobile) plug in without duplicating rules. Controllers should stay thin; fat controllers make reuse and testing expensive.


1. Core idea

Business rules and workflows live in class libraries. Entry points are thin shells that connect those libraries to HTTP, queues, schedules, chat, etc.

[user]
email = abc@gmail.com
name = ABC
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED
[init]
defaultBranch = main
[fetch]
@prabh-62
prabh-62 / global-angular-cli.md
Created March 21, 2021 14:57
Drawbacks of globally installing @angular/cli

Uninstall globally installed Angular CLI. Use npx

When we install @angular/cli globally, we pin the version of ng binary to a specific version which results in us using out-of-date ng binary most of the times(Angular CLI team publishes new version on a weekly basis). And if we are working in a team, we could be out of sync with the rest of developers since each dev might have different version of @angular/cli installed.

Check if you have @angular/cli installed globally

  • NPM npm list --global --depth 0
  • Yarn yarn global list
@prabh-62
prabh-62 / monorepo.md
Created March 21, 2021 14:40
Benefits of a monorepo

How monorepo eventually save $$?

What is monorepo?

When we store all(or most) of our source code in a single git repository, we term the git repository as mono-repository. Mono-repository usually contains multiple applications, and several reusable libraries.

Updating/Debugging library

Typically, when a developer needs to debug a library source code, they have to first clone the library source code and then somehow link the library and application source code together.

Also, if a developer has to update a library, they have to again clone the library source code, make updates and then verify the resulting package. Upon verification, dev publishes newer version of the library.

@prabh-62
prabh-62 / SystemInfo.sh
Last active October 15, 2016 23:09
SystemInfo for Debian based Linux OS
#!/bin/bash
rootCheck="sudo"
# Format SYstemInfo Output
printToFile(){
printf "\n\n" >> $FILE
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - >> $FILE
echo -e "$(tput setaf 1) ${1} $(tput setaf 7) " >> $FILE
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - >> $FILE
@prabh-62
prabh-62 / createA3Movies.sql
Created March 28, 2016 05:53
SQL Script to create Movies Database(based on Assignment 3 requirements) in SQL Server
-- CREATE DATABASE A3Movies
-- USE A3Movies;
-- DROP TABLE Genre;
CREATE TABLE Genre(
GenreID varchar(10) NOT NULL PRIMARY KEY,
GenreType varchar(30) NOT NULL
);
-- DROP TABLE Director;
@prabh-62
prabh-62 / artDB.sql
Created March 14, 2016 16:24
Create artDB.sql Script
CREATE DATABASE artDB;
USE artDB;
CREATE TABLE Paintings(
ID int PRIMARY KEY NOT NULL,
Painting VARCHAR(50) NOT NULL,
ArtistID VARCHAR(5),
ArtType VARCHAR(10),
PDate int
);