Skip to content

Instantly share code, notes, and snippets.

View timheuer's full-sized avatar
🚴‍♂️
https://twitter.com/timheuer

Tim Heuer timheuer

🚴‍♂️
https://twitter.com/timheuer
View GitHub Profile
@timheuer
timheuer / aspire-manifest-schema.json
Last active February 21, 2024 02:08
aspire-manifest-schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Schema for .NET Aspire Manifest",
"type": "object",
"properties": {
"resources": {
"type": "object",
"description": "A list of the resources",
"patternProperties": {
"^[a-zA-Z0-9]+$": {
@timheuer
timheuer / project.csproj
Created February 16, 2024 05:01
set nbgv before
<Target Name="SetContainerTagTarget" BeforeTargets="CoreCompile">
<PropertyGroup>
<ContainerImageTag>$(GitCommitId)</ContainerImageTag>
</PropertyGroup>
</Target>
@timheuer
timheuer / oidc-config.ps1
Last active December 21, 2024 00:25
Script to execute the full set of instructions to wire up OIDC to a GitHub repo with Azure identities for an Azure App Service deployment
param(
[Parameter(Mandatory = $true, HelpMessage = "Your Azure subscription ID")]
[string]$subscriptionId,
[Parameter(Mandatory = $true, HelpMessage = "The name of the managed identity")]
[string]$managedIdName,
[Parameter(Mandatory = $true, HelpMessage = "The name of the resource group")]
[string]$resourceGroupName,
// Open the file in an editor
if (createdFile) {
vscode.workspace.openTextDocument(createdFile).then((document) => {
vscode.window.showTextDocument(document);
});
}
@timheuer
timheuer / azure-pipelines.yaml
Created November 9, 2023 19:28
dotnet8-azpipeline
# Use .NET 8 SDK
# Ensures .NET 8 SDK is installed/used
- task: UseDotNet@2
inputs:
version: 8.0.x
@timheuer
timheuer / profile-vs.ps1
Created October 17, 2023 15:27
Start vs from a command shell
function vs {
$p = Get-Location
$sln = gci *.sln,*.csproj -n -recurse | select -f 1
Write-Output "Opening $p\$sln"
Start-Process -FilePath "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\devenv.exe" -ArgumentList "$p\$sln"
}
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 2,
"final_space": true,
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
@timheuer
timheuer / foo.xaml
Created August 17, 2023 19:09
Get default value of current foreground
<!-- I need the parameter of the foreground to be the current value which will serve as a default if not converted -->
<TextBlock Foreground="{Binding Path=Conclusion,
Converter={StaticResource ConclusionColorConverter},
ConverterParameter={Binding RelativeSource={RelativeSource Mode=Self}}}" Text="{Binding Conclusion}" />
@timheuer
timheuer / Converters.cs
Last active August 17, 2023 04:57
JsonConverters
namespace TempStick;
public class BooleanConverter : JsonConverter<bool>
{
public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.String)
{
return string.Equals(reader.GetString(), "1", StringComparison.OrdinalIgnoreCase);
}
@timheuer
timheuer / filter.jq
Created August 1, 2023 18:14
Query GitHub Issues
["number","title","state","labels"],
(.[] | [
.number,
.title,
.state,
(.labels | if length == 0 then "no-label" elif length > 1 then map(.name) | join(",") else .[0].name end)
]) | @csv