Skip to content

Instantly share code, notes, and snippets.

@Layoric
Layoric / .env
Last active October 14, 2023 13:34
Files used for GitHub Action Docker Deployment via SSH to stand alone Linux server
# Autogenerated .env file
HOST_DOMAIN=web.web-templates.io
[email protected]
APP_NAME=web
IMAGE_REPO=netcoretemplates/web
RELEASE_VERSION=latest
@Layoric
Layoric / release.yml
Created July 28, 2023 05:44
Generic Docker Compose Deployments for GitHub Actions
name: Release
permissions:
packages: write
contents: write
on:
# Triggered on new GitHub Release
release:
types: [published]
# Triggered on every successful Build action
workflow_run:
@Layoric
Layoric / nginx-reverse-proxy.yml
Created July 28, 2023 03:06
Docker compose for Nginx Reverse Proxy and Lets Encrypt Companion
version: "3.9"
services:
nginx-proxy:
image: nginxproxy/nginx-proxy
container_name: nginx-proxy
restart: always
ports:
- "80:80"
- "443:443"
@Layoric
Layoric / mix.md
Last active August 2, 2023 01:56 — forked from gistlyn/mix.md
Mix Gists

Available Gists

Projects

  • console-cs {to:'.'} project,C# C# .NET 6 Console App
  • console-fs {to:'.'} project,F# F# .NET 6 Console App
  • console-vb {to:'.'} project,VB VB .NET 6 Console App
  • console-ss {to:'.'} project,S# #Script Console App
  • console-lisp {to:'.'} project,Lisp #Script Lisp Console App
  • init {to:'.'} project,C# Empty .NET 6 ServiceStack App
@Layoric
Layoric / DiscordAuthProvider.cs
Last active September 14, 2021 02:33
Discord OAuth2 provider for ServiceStack
/// <summary>
/// Create an OAuth2 App at: https://discord.com/developers/applications
/// The Apps Callback URL should match the CallbackUrl here.
/// Discord OAuth2 info: https://discord.com/developers/docs/topics/oauth2
/// Discord OAuth2 Scopes from: https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes
/// email: Basic info, plus will return email info from /users/@me API, this is the minimum required for ServiceStack
/// integration.
///
/// Checking of email verification is enforced due to Discord not requiring verified emails.
///
@Layoric
Layoric / on-startup.sh
Created August 9, 2021 06:55
AWS SageMaker running dotnet 5 and dotnet interactive - based on https://github.com/aws-samples/amazon-sagemaker-dotnet-image-classification
#!/bin/bash
set -e
wget https://download.visualstudio.microsoft.com/download/pr/8468e541-a99a-4191-8470-654fa0747a9a/cb32548d2fd3d60ef3fe8fc80cd735ef/dotnet-sdk-5.0.302-linux-x64.tar.gz
wget https://download.visualstudio.microsoft.com/download/pr/50687c84-e120-4410-bd4a-b1e0869d03f4/6038576259f95ef61d4d103ee3967130/dotnet-runtime-5.0.8-linux-x64.tar.gz
mkdir -p /home/ec2-user/dotnet && tar zxf dotnet-runtime-5.0.8-linux-x64.tar.gz -C /home/ec2-user/dotnet
export DOTNET_ROOT=/home/ec2-user/dotnet
export PATH=$PATH:/home/ec2-user/dotnet
export DOTNET_CLI_HOME=/home/ec2-user/dotnet
export HOME=/home/ec2-user
@Layoric
Layoric / Customers.cs
Last active June 2, 2021 06:21
autoquery-min-code-first
[Route("/customers")]
public class QueryCustomers : QueryDb<Customer> {}
@Layoric
Layoric / AppHost.cs
Created June 2, 2021 06:18
autoquery-just-apphost
// Connect your database
container.AddSingleton<IDbConnectionFactory>(c =>
new OrmLiteConnectionFactory(MapProjectPath("~/northwind.sqlite"), SqliteDialect.Provider));
// Add the AutoQuery Plugin
Plugins.Add(new AutoQueryFeature { MaxLimit = 100 });
@Layoric
Layoric / AppHost.cs
Last active June 2, 2021 06:15
autoquery-custom
// Connect your database
container.AddSingleton<IDbConnectionFactory>(c =>
new OrmLiteConnectionFactory(MapProjectPath("~/northwind.sqlite"), SqliteDialect.Provider));
// Add the AutoQuery Plugin
Plugins.Add(new AutoQueryFeature { MaxLimit = 100 });
@Layoric
Layoric / AppHost.cs
Last active June 2, 2021 06:12
Register AutoQuery Plugin
// Connect your database
container.AddSingleton<IDbConnectionFactory>(c =>
new OrmLiteConnectionFactory(MapProjectPath("~/northwind.sqlite"), SqliteDialect.Provider));
// Configure AutoQuery to Generate CRUD services
Plugins.Add(new AutoQueryFeature {
MaxLimit = 1000,
GenerateCrudServices = new GenerateCrudServices {
AutoRegister = true
}