Skip to content

Instantly share code, notes, and snippets.

using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using MyApp.Data;
using MyApp.Migrations;
using MyApp.ServiceModel;
using ServiceStack;
using ServiceStack.Data;
using ServiceStack.OrmLite;
[assembly: HostingStartup(typeof(MyApp.ConfigureDbMigrations))]
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using MyApp.Data;
using MyApp.Migrations;
using MyApp.ServiceModel;
using ServiceStack;
using ServiceStack.Data;
using ServiceStack.OrmLite;
[assembly: HostingStartup(typeof(MyApp.ConfigureDbMigrations))]
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using MyApp.Data;
using MyApp.Migrations;
using MyApp.ServiceModel;
using ServiceStack;
using ServiceStack.Data;
using ServiceStack.OrmLite;
[assembly: HostingStartup(typeof(MyApp.ConfigureDbMigrations))]
@gistlyn
gistlyn / Configure.OpenApi.cs
Last active February 7, 2024 10:52
openapi3
[assembly: HostingStartup(typeof(MyApp.ConfigureOpenApi))]
namespace MyApp;
public class ConfigureOpenApi : IHostingStartup
{
public void Configure(IWebHostBuilder builder) => builder
.ConfigureServices((context, services) => {
if (context.HostingEnvironment.IsDevelopment())
{
using ServiceStack;
using ServiceStack.DataAnnotations;
using ServiceStack.Host;
using ServiceStack.Model;
using ServiceStack.Text;
using ServiceStack.Web;
[assembly: HostingStartup(typeof(MyApp.ConfigurePostman))]
namespace MyApp;
@gistlyn
gistlyn / typechat.mjs
Last active September 28, 2023 10:35
typechat.mjs
import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { createLanguageModel, createJsonTranslator, createProgramTranslator } from 'typechat'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const useProgram = process.argv[2].toLowerCase() === "program"
const model = createLanguageModel(process.env)
@gistlyn
gistlyn / .deploy\nginx-proxy-compose.yml
Last active October 14, 2023 12:58
Files used for GitHub Action Docker Deployment via SSH to stand alone Linux server
version: "3.9"
services:
nginx-proxy:
image: nginxproxy/nginx-proxy
container_name: nginx-proxy
restart: always
ports:
- "80:80"
- "443:443"
@gistlyn
gistlyn / docker-compose.prod.yml
Created July 31, 2023 08:29 — forked from Layoric/.env
Files used for GitHub Action Docker Deployment via SSH to stand alone Linux server
version: "3.9"
services:
app:
image: ghcr.io/${IMAGE_REPO}:${RELEASE_VERSION}
restart: always
ports: !reset ["80"]
container_name: ${IMAGE_REPO}-app
environment:
VIRTUAL_HOST: ${HOST_DOMAIN}
LETSENCRYPT_HOST: ${HOST_DOMAIN}
@gistlyn
gistlyn / benchmarks.md
Last active July 28, 2023 09:41
Bulk Insert Performance

BenchmarkDotNet v0.13.6, Windows 10 (10.0.19045.3208/22H2/2022Update) Intel Core i7-7700K CPU 4.20GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores .NET SDK 7.0.203 [Host] : .NET 6.0.20 (6.0.2023.32017), X64 RyuJIT AVX2 Job-YNLYPT : .NET 6.0.20 (6.0.2023.32017), X64 RyuJIT AVX2

Method Database n Mean Error StdDev
BatchInserts Memory 1000000 2.332 s 0.0288 s 0.0255 s
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="ServiceStack Pre-Release" value="https://f.feedz.io/servicestack/pre-release/nuget/index.json" />
</packageSources>
</configuration>