Skip to content

Instantly share code, notes, and snippets.

View vibs2006's full-sized avatar

vibs2006

View GitHub Profile
@vibs2006
vibs2006 / ASP.NET.Core.6.Startup.cs
Last active June 14, 2023 12:15
SELF HOST API with Swagger Configuration for all .NET Versions
public class Program
{
static void Main(string[] args)
{
Console.WriteLine("Starting Padauk Web API Services");
try
{
var applicationName = "Padauk.API";
var builder = WebApplication.CreateBuilder(args);
var startup = new WebHostStartup(builder.Configuration);
@vibs2006
vibs2006 / Path.Combine.Javascript.js
Last active June 14, 2023 12:38
Javascript Helper Methods
//Path.Combine Equivalent in Javascript
function pathJoin(parts, sep){
const separator = sep || '/';
parts = parts.map((part, index)=>{
if (index) {
part = part.replace(new RegExp('^' + separator), '');
}
if (index !== parts.length - 1) {
@vibs2006
vibs2006 / Readme.Md
Last active June 14, 2023 12:17
C# Small Utilities
  1. Recursive Inner Exception Looping for Logging Purpose.
@vibs2006
vibs2006 / OPENJSON.sql
Last active June 14, 2023 12:24
SQL Server Use Case Examples
declare @json varchar(max) = '[
{
"InvoiceNumber": 3333428,
"PaidAmount": 10.0,
"Bank": "Bank Name 1",
"PaymentReference": "PaymentReference 1"
},
{
"InvoiceNumber": 2457759,
"PaidAmount": 15.0,