Skip to content

Instantly share code, notes, and snippets.

@gistlyn
gistlyn / ss-utils.js
Last active April 26, 2024 10:27
rewrite ss-utils.js to minimize allocations in IE
;(function (root, f) {
if (typeof exports === 'object' && typeof module === 'object')
module.exports = f(require("jquery"));
if (typeof define === "function" && define.amd)
define(["jquery"], f);
else if (typeof exports === "object")
f(require("jquery"));
else
f(root.jQuery);
})(this, function ($) {
@gistlyn
gistlyn / hello.rb
Last active March 17, 2024 01:16
Ruby Hello World
puts "Hello World!"
@gistlyn
gistlyn / Configure.Db.Migrations.cs
Last active March 6, 2024 16:19
Use OrmLite with SQLite
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))]
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 / mix.md
Last active March 6, 2024 08:30
Mix Gists

Available Gists

Projects

  • console-cs {to:'.'} project,C# C# .NET 8 Console App
  • console-fs {to:'.'} project,F# F# .NET 8 Console App
  • console-vb {to:'.'} project,VB VB .NET 8 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 8 ServiceStack App
@gistlyn
gistlyn / Configure.Db.Migrations.cs
Last active March 6, 2024 07:31
Use OrmLite with SQL Server
using MyApp.Migrations;
using ServiceStack;
using ServiceStack.Data;
using ServiceStack.OrmLite;
[assembly: HostingStartup(typeof(MyApp.ConfigureDbMigrations))]
namespace MyApp;
// Code-First DB Migrations: https://docs.servicestack.net/ormlite/db-migrations
@gistlyn
gistlyn / Configure.Cors.cs
Last active February 20, 2024 09:41
Configure support for CORS
[assembly: HostingStartup(typeof(MyApp.ConfigureCors))]
namespace MyApp;
public class ConfigureCors : IHostingStartup
{
public void Configure(IWebHostBuilder builder) => builder
.ConfigureServices(services =>
{
services.AddCors(options => {
using Funq;
using ServiceStack;
using MyApp.ServiceInterface;
[assembly: HostingStartup(typeof(MyApp.AppHost))]
namespace MyApp;
public class AppHost : AppHostBase, IHostingStartup
{