Skip to content

Instantly share code, notes, and snippets.

View awright18's full-sized avatar

Adam Wright awright18

View GitHub Profile
@awright18
awright18 / EndpointConfigurationBuilder.cs
Created October 21, 2023 17:48
EndpointConfigurationBuilder
public class EndpointConfigurationBuilder
{
private EndpointConfiguration _endpointConfiguration;
public EndpointConfigurationBuilder(string endpointName)
{
_endpointConfiguration = new EndpointConfiguration(endpointName);
}
public EndpointConfigurationBuilder UseTransport<TTransport>(
TTransport transportDefinition,
https://retropie.org.uk/forum/topic/29996/issue-connecting-bluetooth-8bitdo-sn30-pro-controller/5
THE FIX:
You need to exit RetroPie settings (go back to the Emulation Station menu) and the exit Emulation Station by pressing F4. This will take you back to the console.
From there, run this command to edit a file:
sudo nano /lib/systemd/system/bluetooth.service
Replace
@awright18
awright18 / IgnoreAntiForgertyTokenPage.cshtml.cs
Created September 16, 2021 19:08
Razor Pages Ignore Antiforgery Token
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace RazorPagesDemo.Pages
{
[IgnoreAntiforgeryToken] //this will allow post without Antiforgery tokens. Good for Ajax style requests
public class Clicked : PageModel
{
public void OnGet()
@awright18
awright18 / resignation.txt
Created June 28, 2021 16:17 — forked from QuinnyPig/resignation.txt
Templated resignation letter
Dear BOSS,
Please accept this letter as formal notification that I am resigning from my position as JOB TITLE with COMPANY. My last day will be DATE OF LAST DAY.
Thank you so much for the opportunity to work in this position for the past DURATION. I’ve greatly enjoyed and appreciated the opportunities I’ve had to WTF DID YOU DO, and I’ve learned many things, all of which I will take with me throughout my career.
During my last two weeks, I’ll do everything possible to wrap up my duties and train other team members. Please let me know if there’s anything else I can do to aid during the transition.
I wish COMPANY continued success, and I hope to stay in touch in the future.
Sincerely,
@awright18
awright18 / Word2Pdf.cs
Created February 25, 2021 16:23
Word To Pdf Conversion - Using Microsoft.Office.Interop.Word
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);
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"
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\dn3.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
@awright18
awright18 / Clean Local Git Repo
Last active May 12, 2022 19:12
Clean up local Git Branches
function CleanLocalGitRepo
{
git checkout master; git remote update origin --prune; git branch -vv |
Select-String -Pattern ": gone]" |
% { $_.toString().Trim().Split(" ")[0]} |
% {git branch -d $_ }
}
Set-Alias Get-GitClean CleanLocalGitRepo
@awright18
awright18 / program.cs
Last active September 20, 2018 10:20
Setting Up Serilog with Asp.Net Core
public class Program
{
public IConfiguration Configuration =
new ConfigurationBuilder()
.AddJsonFile("appSettings.json")
.AddEnvironmentVariables()
.AddUserSecrets<StartUp>();
public static Task<int> Main(string[] args)
{
@awright18
awright18 / Web.config App Settings
Last active September 14, 2018 04:14
Web.Config App Settings
<AppSettings>
<Add Name="Foo" Value="Bar" />
</AppSettings>