Skip to content

Instantly share code, notes, and snippets.

gistlyn

Block or report user

Report or block gistlyn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gistlyn
gistlyn / ss-utils.js
Last active Jan 23, 2020
rewrite ss-utils.js to minimize allocations in IE
View ss-utils.js
;(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 / Feature.UserAuth.cs
Last active Jan 21, 2020
List and Search Users registered in Auth Repository
View Feature.UserAuth.cs
using ServiceStack;
using ServiceStack.Script;
namespace MyApp
{
public class FeatureUserAuth : IConfigureAppHost, IPostInitPlugin
{
public void Configure(IAppHost appHost)
{
appHost.AssertPlugin<SharpPagesFeature>().ScriptMethods.Add(new UserAuthScripts());
@gistlyn
gistlyn / Configure.Mq.cs?
Last active Jan 21, 2020
Add /messaging pages and Services to test sending MQ messages
View Configure.Mq.cs?
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using ServiceStack;
using ServiceStack.Messaging;
namespace MyApp
{
/**
Register Services you want available via MQ in your AppHost, e.g:
var mqServer = container.Resolve<IMessageService>();
View Configure.MongoDb.cs
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using ServiceStack;
using ServiceStack.DataAnnotations;
using MongoDB.Driver;
namespace MyApp
{
public class ConfigureMongoDb : IConfigureServices
{
@gistlyn
gistlyn / Dockerfile
Last active Jan 17, 2020
Dockerfile example for .NET Core Web Apps
View Dockerfile
FROM microsoft/dotnet:2.1-aspnetcore-runtime
COPY app /app
WORKDIR /app
EXPOSE 5000/tcp
ENV ASPNETCORE_URLS https://*:5000
ENTRYPOINT ["x"]
@gistlyn
gistlyn / main.cs
Last active Jan 14, 2020
Modify Table Schema Examples
View main.cs
using System;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open();
@gistlyn
gistlyn / main.cs
Last active Jan 14, 2020
Create Tables with Foreign Keys
View main.cs
using System;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open();
@gistlyn
gistlyn / main.cs
Last active Jan 14, 2020
Create Tables with Foreign Keys
View main.cs
using System;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open();
@gistlyn
gistlyn / main.cs
Last active Jan 14, 2020
Create Tables with Complex Types
View main.cs
using System.Collections.Generic;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open();
public class ArtistWithBlobTracks
@gistlyn
gistlyn / main.cs
Last active Jan 14, 2020
Customize Tables using Attributes
View main.cs
using System;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open();
You can’t perform that action at this time.