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.ComponentModel; | |
| using Microsoft.SemanticKernel; | |
| public sealed class TimePlugin | |
| { | |
| [KernelFunction] | |
| [Description("Retrieves the current time in UTC")] | |
| public string GetCurrentUtcTime() => DateTime.UtcNow.ToString("R"); | |
| } |
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
| public interface IMediator | |
| { | |
| TResponse Request<TResponse>(IQuery<TResponse> query); | |
| Task<TResponse> RequestAsync<TResponse>(IQuery<TResponse> query); | |
| void Send(ICommand command); | |
| Task SendAsync(ICommand command); |
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
| async function createOrderCallback() { | |
| try { | |
| const response = await fetch("/payV2/checkout", { | |
| method: "POST", | |
| headers: { | |
| "Content-Type": "application/json", | |
| } | |
| }); | |
| const orderData = await response.json(); |
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
| FROM Stack Overflow | |
| https://stackoverflow.com/a/54697319/15410 | |
| I see this EXACT problem from time to time, when using SSL, and have found that (especially when working on someone else's project in a team environment) the Visual Studio project web settings (SSL ports) sometimes get messed up. Here's what I do to fix them: | |
| In Solution Explorer, click your project. |
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
| function New-Tag { | |
| [CmdletBinding(SupportsShouldProcess=$true)] | |
| param( | |
| [Parameter(Mandatory=$true)] | |
| [string] $Tag) | |
| process { | |
| if ($PSCmdlet.ShouldProcess("git tag $Tag")) { | |
| Write-Verbose "git tag $Tag" | |
| git tag $Tag | |
| } |
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
| private static Task<string> foo = null; | |
| private static async Task<string> GetFooDataAsync() | |
| { | |
| async Task<string> GetFooDataInternal() | |
| { | |
| var response = await myHttpClient.GetFooAsync(); | |
| return response.data; | |
| } |
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
| const puppeteer = require('puppeteer'); | |
| /** | |
| * This is a thin wrapper so that we use a singleton of | |
| * the browser that puppeteer creates | |
| */ | |
| class Browser { | |
| setUp(done) { | |
| const puppeteerOpts = this.options && this.options.puppeteer ? | |
| this.options.puppeteer : |
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
| public class ConnectionFactory { | |
| public static DbConnection GetOpenConnection() { | |
| var connection = new SqlConnection("MyConnectionString"); | |
| connection.Open(); | |
| return connection; | |
| } | |
| } |
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
| var AccountLoginPage = function (chromeless, options) { | |
| this.chromeless = chromeless | |
| this.options = options | |
| this.usernameLocator = 'input[id="Username"]' | |
| this.passwordLocator = 'input[id="Password"]' | |
| this.submitButtonLocator = 'form input[type="submit"]' | |
| this.inputWithValidationErrorLocator = 'input.input-validation-error' | |
| this.usernameRequiredValidationLocator = '.field-validation-error[data-valmsg-for="Username"]' |
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
| [HtmlTargetElement("div")] | |
| public class VisibilityTagHelper : TagHelper | |
| { | |
| public bool IsVisible { get; set; } = true; | |
| public override void Process(TagHelperContext context, TagHelperOutput output) | |
| { | |
| if (!IsVisible) | |
| output.SuppressOutput(); |
NewerOlder