Skip to content

Instantly share code, notes, and snippets.

View codeprefect's full-sized avatar
💯
building saas solutions

Mubarak Imam codeprefect

💯
building saas solutions
View GitHub Profile
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Multitenant.Models;
using MultiTenant.Data.Interfaces;
namespace Multitenant.Data
{
public class DbContextFactory : IDbContextFactory
{
public ApplicationDbContext CreateDbContext(Tenant tenant, IConfiguration configuration)
@codeprefect
codeprefect / dnc-bootstrap
Created November 29, 2019 19:57
Create new ASP.NET Core solution with Entities class library, Data class library and Web MVC project
#!/bin/bash
# create new solution based on input argument
create_new_solution () {
local root_dir=$1
echo creating solution : $root_dir
# create solution directory
mkdir $root_dir
dotnet new sln -o $root_dir
@codeprefect
codeprefect / RSAAuth.cs
Created March 9, 2020 09:30
JWT Authentication with RSA Keys
using System;
using System.Security.Cryptography;
using Microsoft.IdentityModel.JsonWebTokens;
using Microsoft.IdentityModel.Tokens;
public class RSAAuth
{
[Fact]
public void RSATest
@codeprefect
codeprefect / wkhtmltopdf-debug.html
Created August 16, 2021 09:37
Debugging wkhtmltopdf italicize bug
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.10">
<title>Objectives</title>
<link rel="stylesheet"
@codeprefect
codeprefect / codeprefect.omp.json
Last active September 10, 2021 10:32
Oh My Posh
{
"blocks": [
{
"type": "prompt",
"alignment": "left",
"newline": true,
"segments": []
},
{
"type": "prompt",