I want a script that will give me:
- Logging
- Log purging!
- Email errors!
- Prevent duplicate processes! (flock)
- Source an environment file!
- Anything else?
object FileName = tempFilePath; | |
object FileFormat = msWord.WdSaveFormat.wdFormatFilteredHTML; | |
object LockComments = false; | |
object Password = System.Reflection.Missing.Value; | |
object AddToRecentFiles = false; | |
object WritePassword = System.Reflection.Missing.Value; | |
object ReadOnlyRecommended = false; | |
object EmbedTrueTypeFonts = false; | |
object SaveNativePictureFormat = System.Reflection.Missing.Value; | |
object SaveFormsData = false; |
[HttpPost] | |
public ActionResult ConfirmLink(string id) | |
{ | |
try | |
{ | |
var confirmationMessage = SomeRepo.ConfirmLink(id); | |
return Json(new { confirmationMessage = confirmationMessage }, JsonRequestBehavior.AllowGet); | |
} | |
catch (Exception ex) | |
{ |
namespace My.Models.BaseModels | |
{ | |
public class AuditableEntity | |
{ | |
public int Id { get; set; } | |
public DateTime CreatedDt { get; set; } | |
public string CreatedBy { get; set; } | |
public DateTime RevisedDt { get; set; } | |
public string RevisedBy { get; set; } | |
} |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Data.Entity; | |
using System.Linq; | |
using System.Linq.Expressions; | |
namespace FCM.Web.Tests.TestHelpers | |
{ |
[Test] | |
public void GetSimilarity_SpaceInTarget_NotZero() | |
{ | |
var matcher = new SimMetricsMetricUtilities.JaroWinkler(); | |
var target = " 1 main"; | |
var candidate = "1 main st"; | |
var similarity = matcher.GetSimilarity(candidate, target); | |
var message = string.Format("Expect similarity {0} to be > .9", similarity); | |
Assert.IsTrue(similarity > .90, message); |
[TestMethod] | |
public void PrintListIds() | |
{ | |
PrintListIds("key", "id"); | |
PrintListIds("key", "id"); | |
PrintListIds("key", "id"); | |
} | |
private static void PrintListIds(string apiKey, string clientId) | |
{ |
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(); | |
} | |
}); | |
} |
public class FooDbContextFactory : IDesignTimeDbContextFactory<FooDbContext> | |
{ | |
public FooDbContext CreateDbContext(string[] args) | |
{ | |
var optionsBuilder = new DbContextOptionsBuilder<FooDbContext>(); | |
optionsBuilder.UseSqlServer("DeaultConnection"); | |
return new FooDbContext(optionsBuilder.Options); | |
} | |
} |
using System; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleTestApp1 | |
{ | |
class Program | |
{ |