I want a script that will give me:
- Logging
- Log purging!
- Email errors!
- Prevent duplicate processes! (flock)
- Source an environment file!
- Anything else?
using Domain.Toolkit; | |
using Domain.Sample.AppModels.Attributes; | |
using Domain.Sample.DbModels.Sample; | |
namespace Domain.Sample.Services.Attributes; | |
public class AttributeCrudCommands : IAttributeCrudCommands | |
{ | |
private readonly SampleDbContext _db; | |
private readonly ILogger<AttributeCrudCommands> _logger; |
using System.Collections.ObjectModel; | |
using System.Runtime.CompilerServices; | |
using System.Security.Cryptography.X509Certificates; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.EntityFrameworkCore; | |
namespace MyApplication.Web.Controllers | |
{ | |
public class ProductControl : Controller | |
{ |
Using this file to rename the gist |
using Ganss.XSS; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace VEIC.Tracker.Services.Tests.Shared | |
{ | |
[TestClass] | |
public class HtmlSanitizerTests | |
{ | |
private IHtmlSanitizer _htmlSanitizer; |
BEGIN -- Delete all tables in order to re-create. | |
DECLARE @sql NVARCHAR(MAX); | |
SET @sql = N''; | |
SELECT @sql = @sql + N' | |
ALTER TABLE ' + QUOTENAME(s.name) + N'.' | |
+ QUOTENAME(t.name) + N' DROP CONSTRAINT ' | |
+ QUOTENAME(c.name) + ';' | |
FROM sys.objects AS c | |
INNER JOIN sys.tables AS t |
using System; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleTestApp1 | |
{ | |
class Program | |
{ |
public class FooDbContextFactory : IDesignTimeDbContextFactory<FooDbContext> | |
{ | |
public FooDbContext CreateDbContext(string[] args) | |
{ | |
var optionsBuilder = new DbContextOptionsBuilder<FooDbContext>(); | |
optionsBuilder.UseSqlServer("DeaultConnection"); | |
return new FooDbContext(optionsBuilder.Options); | |
} | |
} |
Vue.directive('on-show-bs-tab', { | |
bind: function (el, binding) { | |
// This is BS4 jQuery | |
// When the tab is activated, load the data! | |
$(el).on('show.bs.tab', function (e) { | |
if (typeof binding.value === "function") { | |
binding.value.call(); | |
} | |
}); | |
} |
[TestMethod] | |
public void PrintListIds() | |
{ | |
PrintListIds("key", "id"); | |
PrintListIds("key", "id"); | |
PrintListIds("key", "id"); | |
} | |
private static void PrintListIds(string apiKey, string clientId) | |
{ |