Skip to content

Instantly share code, notes, and snippets.

Avatar
💯
building saas solutions

Mubarak Imam codeprefect

💯
building saas solutions
View GitHub Profile
View DbContextFactory.cs
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 Nov 29, 2019
Create new ASP.NET Core solution with Entities class library, Data class library and Web MVC project
View dnc-bootstrap
#!/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 Mar 9, 2020
JWT Authentication with RSA Keys
View RSAAuth.cs
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 Aug 16, 2021
Debugging wkhtmltopdf italicize bug
View wkhtmltopdf-debug.html
<!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"
View codeprefect.omp.json
{
"blocks": [
{
"type": "prompt",
"alignment": "left",
"newline": true,
"segments": []
},
{
"type": "prompt",