Skip to content

Instantly share code, notes, and snippets.

View MiniverCheevy's full-sized avatar

Shawn Doucet MiniverCheevy

View GitHub Profile
sfc /scannow
CHKDSK /R /F
DISM.exe /Online /Cleanup-image /Restorehealth
DISM.exe /Online /Cleanup-image /Scanhealth
REM NET stop "SQL Server (MSSQLSERVER)"
REM NET start "SQL Server (MSSQLSERVER)"
REM taskkill /im webdev.webserver.exe /f
REM taskkill /im WebDev.WebServer40.exe /f
REM taskkill /im iisexpress.exe /f
REM ipconfig /release
REM ipconfig /renew
REM ipconfig /flushdns
@MiniverCheevy
MiniverCheevy / StackExchangeExceptionalLogger.cs
Created January 20, 2016 23:33
ILogger for use with StackExchange Exceptional
public class ExceptionalLogger : ILogger
{
static ExceptionalLogger()
{
VoodooGlobalConfiguration.ErrorDetailLoggingMethodology = ErrorDetailLoggingMethodology.LogInExceptionData;
}
public void Log(string message)
{
ErrorStore.LogException(new Exception(message), HttpContext.Current);
}
@MiniverCheevy
MiniverCheevy / ElmahtiyFramework
Last active August 29, 2015 14:21
ElmahtiyFrameworkContext - stored procedure free elmah entity framework provider error log
public interface IElmahtiyFrameworkContext
{
DbSet<ErrorLog> Errors { get; set; }
}
public class ErrorLog
{
[Index]
public Guid ErrorId { get; set; }
@MiniverCheevy
MiniverCheevy / iTextSharp html to pdf
Last active August 29, 2015 14:17
iTextSharp html to pdf
using System;
using System.Collections.Generic;
using System.Data.Entity.Core.Mapping;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.tool.xml;
@MiniverCheevy
MiniverCheevy / MappingTestHelper.cs
Last active August 29, 2015 14:09
Mapping Test Helper
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Voodoo;
namespace Tests
{
public class MappingTesterHelper<TSource, TTarget>
{
@MiniverCheevy
MiniverCheevy / DbContext
Last active August 29, 2015 14:09
DbContext
public class ADbContext: DbContext
{
public ADbContext: () : base("DefaultConnection")
{
this.Configuration.ProxyCreationEnabled = false;
this.Configuration.LazyLoadingEnabled = false;
var ensureDllIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance;
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
@MiniverCheevy
MiniverCheevy / LocalSSRSSample
Last active August 29, 2015 14:09
Local SSRS Reports
localReport report = new LocalReport();
report.ReportPath = "SomePath";
report.DataSources.Clear();
report.DataSources.Add(new ReportDataSource("SomeDataSourceName",
SomeCollectionObject));
report.DataSources.Add(new ReportDataSource("SomeOtherDataSourceName",
SomeOtherCollectionObject));
Warning[] warnings;
string[] streamids;
string mimeType, encoding, filenameExtension;
@MiniverCheevy
MiniverCheevy / Renamer.cs
Created November 3, 2014 15:30
Recursive Solution Renamer
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace Renamer
{
internal class Program
{
@MiniverCheevy
MiniverCheevy / ElmahLogger.cs
Last active August 29, 2015 14:06
Voodoo.Logging.ILogger Implementations
public class ElmahLogger: Voodoo.Logging.ILogger
{
public void Log(string message)
{
using (var scope = new TransactionScope(TransactionScopeOption.Suppress))
{
var exception = new Exception(message);
ErrorSignal.FromCurrentContext().Raise(exception);
}