Skip to content

Instantly share code, notes, and snippets.

View derekforeman's full-sized avatar

Derek derekforeman

View GitHub Profile
@derekforeman
derekforeman / addmigration.sh
Created January 18, 2021 21:51
Add migrations for two providers at one time.
#!/usr/bin/env bash
set -o errexit # Exit on most errors (see the manual)
set -o errtrace # Make sure any error trap is inherited
set -o nounset # Disallow expansion of unset variables
set -Eeuo pipefail # Use last non-zero exit code in a pipelin
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

Catalyst

dotnet build -t:Run -f net6.0-maccatalyst

iOS

Build with default simulator

dotnet build -t:Run -f net6.0-ios

Buid with specific simulator

/Applications/Xcode.app/Contents/Developer/usr/bin/simctl list

@derekforeman
derekforeman / MauiWindows_NoMSIXPackage.md
Last active September 19, 2022 19:05
Build a Maui windows desktop app, do not create MSIX package

Edit *.csproj

Within a <PropertyGroup />, existing or create a new one add the following.

<!--Do not create package for windows--> <WindowsPackageType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">None</WindowsPackageType>

Save and close.

Edit Properties\launchSettings.json

@derekforeman
derekforeman / HttpLoggingHandler.cs
Created July 25, 2023 09:24 — forked from flobaader/HttpLoggingHandler.cs
Log HTTP Requests with Refit
public class HttpLoggingHandler : DelegatingHandler
{
public HttpLoggingHandler(HttpMessageHandler innerHandler = null)
: base(innerHandler ?? new HttpClientHandler())
{
}
async protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)
{