Skip to content

Instantly share code, notes, and snippets.

View sfmohassel's full-sized avatar
😄
Happy

Aria Mohassel sfmohassel

😄
Happy
View GitHub Profile
@sfmohassel
sfmohassel / Hexagonal Architecture.svg
Created February 12, 2025 17:40 — forked from EliFuzz/Hexagonal Architecture.svg
Hexagonal Architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sfmohassel
sfmohassel / README.md
Created February 9, 2025 18:36 — forked from corlaez/README.md
Hexagonal Architecture and Modular Implementation

Hexagonal Architecture

Conceptualized by Alistair Cockburn. Also known as "Ports and Adapters".

In a nutshell:

Application Driver -> Primary Adapter -> Primary Port -> Use Case -> Secondary Port -> Secondary Adapter -> External System/Side Effect
@sfmohassel
sfmohassel / SSL-nginx-Docker.md
Created September 14, 2023 15:01 — forked from dahlsailrunner/SSL-nginx-Docker.md
SSL with Docker images using nginx as reverse proxy

Docker with SSL and an nginx reverse proxy

Running your ASP.NET Core (or other) application in Docker using SSL should not be an overwhelming task. These steps should do the trick.

Run the following steps from a Linux terminal (I used WSL or WSL2 on Windows from the Windows Terminal).

1. Create a conf file with information about the cert you'll be creating

It should look something like the content below; call it my-site.conf or something like that.

@sfmohassel
sfmohassel / CleanArchitecture.md
Created August 26, 2023 17:25 — forked from ygrenzinger/CleanArchitecture.md
Summary of Clean Architecture by Robert C. Martin

Summary of book "Clean Architecture" by Robert C. Martin

Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.

Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.

Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.

The book is build around 34 chapters organised in chapters.

@sfmohassel
sfmohassel / clean_code.md
Created August 26, 2023 17:25 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@sfmohassel
sfmohassel / Generate RSA Key-Value Pair for JWK.sh
Last active July 18, 2023 17:43
Generate RSA Key-Value Pair for JWK
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# enter no password!
# copy fingerprint and store it. You can use it as Key ID
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key | tr -d '\n'
cat jwtRS256.key.pub | tr -d '\n'
@sfmohassel
sfmohassel / excludeWSL.ps1
Last active July 18, 2023 17:38 — forked from noelbundick/LICENSE
Exclude WSL installations from Windows Defender realtime protection
############
# This script will add your WSL environments to the Windows Defender exclusion list so that
# realtime protection does not have an adverse effect on performance.
#
# You should be aware that this could make your system less secure. Use at your own risk.
# Note: This should be run from an administrative PowerShell prompt
############
# Find registered WSL environments
$wslPaths = (Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object { Get-ItemProperty $_.PSPath}).BasePath
@sfmohassel
sfmohassel / add-groups.sh
Last active March 28, 2024 13:52
setup-ssh
#!/bin/bash
# gold group
if grep -q gold /etc/group
then
echo "gold exists"
else
sudo groupadd gold
fi
class Name {
private _firstName: string = "";
private _lastName: string = "";
constructor(firstName: string, lastName: string) {
this.setFirstName(firstName);
this.setLastName(lastName);
}
private setFirstName(firstName: string): void {
class Book {
private _title: string = "";
private _isPublished: boolean = false;
private _publishedAt: Date | undefined;
constructor(
title: string,
isPublished: boolean,
publishedAt: Date | undefined
) {
this.setTitle(title);