Skip to content

Instantly share code, notes, and snippets.


Adam Wright awright18

View GitHub Profile
awright18 / Word2Pdf.cs
Created Feb 25, 2021
Word To Pdf Conversion - Using Microsoft.Office.Interop.Word
View Word2Pdf.cs
using Microsoft.Office.Interop.Word;
namespace Word2Pdf
class Program
static void Main(string[] args)
Application appWord = new Application();
var wordDocument = appWord.Documents.Open(@"c:\users\awright2\desktop\imaword.docx",ReadOnly:true);
View gist:9efbf4173315d6da72d538d8025ed192
Import-Module posh-git
Import-Module oh-my-posh
Import-Module MSTerminalSettings
Set-Theme Paradox
function Restore-CleanAndBuildSln
gci *.sln | nuget.exe restore
gci *.sln | Invoke-MsBuild -MsBuildParameters "/target:EnsureNuGetPackageBuildImports;Clean;Build"
View web.config
<?xml version="1.0" encoding="utf-8"?>
<location path="." inheritInChildApplications="false">
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
<aspNetCore processPath="dotnet" arguments=".\dn3.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
awright18 / program.cs
Last active Sep 20, 2018
Setting Up Serilog with Asp.Net Core
View program.cs
public class Program
public IConfiguration Configuration =
new ConfigurationBuilder()
public static Task<int> Main(string[] args)
awright18 / Web.config App Settings
Last active Sep 14, 2018
Web.Config App Settings
View Web.config App Settings
<Add Name="Foo" Value="Bar" />
awright18 / web.config ConnectionStrings
Last active Sep 14, 2018
.NET Framework Connection String Configuration
View web.config ConnectionStrings
<Add name="MyDatabaseConnectionString"
connectionString="Data Source=".";
Initial Catalog="MyDataBase";
Integrated Secruity=true;" />
awright18 / Result.cs
Created Apr 26, 2018
Functional Result in C#
View Result.cs
using System;
using System.Runtime.InteropServices.ComTypes;
namespace Result
public static class Result
public static Result<T,TError> Ok<T,TError>(T value)
awright18 / template.json
Last active Oct 20, 2017
dotnet new template.json intializing a git repository
View template.json
"$schema": "",
"author": "Adam",
"classifications": [ "classlib" ],
"name": "My class lib",
"identity": "Adam.ClassLib2.CSharp",
"shortName": "MyClassLib", // You can create the project using this short name instead of the one above.
"tags": {
awright18 /
Last active Jul 18, 2017 — forked from davidfowl/
.NET project structure
awright18 / NotEnums.cs
Created Jul 11, 2017
A way to avoid having to use enums
View NotEnums.cs
using System;
namespace NotEnums
public class Options
public string Value { get; private set; }
private const string Option1 = "Option1";
private const string Option2 = "Option2";