This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PowerShell functions for managing git worktrees with agent pattern | |
| # Based on: https://gist.github.com/dhh/18575558fc5ee10f15b6cd3e108ed844 | |
| function ga { | |
| <# | |
| .SYNOPSIS | |
| Create a new git worktree and branch | |
| .DESCRIPTION | |
| Creates a new git worktree with a branch name following the pattern: | |
| ../[current-dir]--[branch-name] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create a new worktree and branch from within current git directory. | |
| ga() { | |
| if [[ -z "$1" ]]; then | |
| echo "Usage: ga [branch name]" | |
| exit 1 | |
| fi | |
| local branch="$1" | |
| local base="$(basename "$PWD")" | |
| local path="../${base}--${branch}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Threading; | |
| /// <summary> | |
| /// Interlocked helper methods. | |
| /// </summary> | |
| public static class InterlockedState | |
| { | |
| /// <summary> | |
| /// Executes a state transition from one state to another. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Snippet from Program.cs which adds the provider and sets up a Settings class to map the settings | |
| using ErikNoren.Configuration; | |
| using TestMvcWebApplication; | |
| var builder = WebApplication.CreateBuilder(args); | |
| builder.Configuration.AddSqlDatabase(config => | |
| { | |
| //We can get the connection string from previously added ConfigurationProviders to use in setting this up | |
| config.ConnectionString = builder.Configuration.GetConnectionString("DemoDatabase"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Buffers; | |
| using System.Net.WebSockets; | |
| var builder = WebApplication.CreateBuilder(args); | |
| var app = builder.Build(); | |
| app.MapGet("/ws", async (HttpContext context) => | |
| { | |
| const int MaxMessageSize = 1024 * 1024; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Threading.Tasks; | |
| namespace System.Collections.Concurrent | |
| { | |
| public static class ConcurrentDictionaryExtensions | |
| { | |
| /// <summary> | |
| /// Provides an alternative to <see cref="ConcurrentDictionary{TKey, TValue}.GetOrAdd(TKey, Func{TKey, TValue})"/> that disposes values that implement <see cref="IDisposable"/>. | |
| /// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using YamlDotNet.Core; | |
| using YamlDotNet.Core.Events; | |
| using YamlDotNet.Serialization; | |
| using YamlDotNet.Serialization.NodeDeserializers; | |
| namespace Egret.Cli.Models | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Microsoft.Extensions.Caching.Memory; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.Extensions.Logging; | |
| using Microsoft.Extensions.Primitives; | |
| using Nito.Logging; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // MIT License | |
| // | |
| // Copyright (c) 2018 Kristian Hellang | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Project> | |
| <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> | |
| <PropertyGroup> | |
| <TargetFramework>netstandard1.0</TargetFramework> | |
| <IsPackable>true</IsPackable> | |
| <IncludeBuildOutput>false</IncludeBuildOutput> | |
| <ContentTargetFolders>contentFiles</ContentTargetFolders> | |
| <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> |
NewerOlder