Skip to content

Instantly share code, notes, and snippets.

View beachside-project's full-sized avatar
😄

Atsushi YOKOHAMA beachside-project

😄
View GitHub Profile
@beachside-project
beachside-project / SearchClientFactory.cs
Last active August 2, 2023 23:28
Cognitive Search client factory sample
using Azure;
using Azure.Core.Serialization;
using Azure.Search.Documents;
using Azure.Search.Documents.Indexes;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Text.Json;
namespace SerializerCustomizeSamples
{
@beachside-project
beachside-project / Sample.cs
Last active August 2, 2023 23:00
Cognitive Search - Camel case sample for System.Text.Json dependency
// こんな定義があるとして
// TODO: Cognitive Search の Uri をセット
private static readonly Uri SearchEndpoint = new Uri("");
// TODO: ADMIN の API キーをセット
private const string AdminApiKey = "";
// TODO: インデックス名をセット
private const string IndexName = "";
// using statement
using Azure;
@beachside-project
beachside-project / Sample.cs
Last active August 2, 2023 23:00
Cognitive Search - Camel case sample for Newtonsoft dependency
// こんな定義があるとして
// TODO: Cognitive Search の Uri をセット
private static readonly Uri SearchEndpoint = new Uri("");
// TODO: ADMIN の API キーをセット
private const string AdminApiKey = "";
// TODO: インデックス名をセット
private const string IndexName = "";
// using statement
using Microsoft.DeepDev;
namespace OpenAISdkSamples;
public class TokenizerSample
{
private const string ImStart = "<|im_start|>";
private const string ImEnd = "<|im_end|>";
private static readonly Dictionary<string, int> SpecialTokens = new()
@beachside-project
beachside-project / matrix-simple.yml
Last active June 30, 2023 01:09
Azure Pipelines matrix sample(1)
name: matrix1
stages:
- stage: matrix_demo
jobs:
- job: job_a
pool:
vmImage: ubuntu-latest
steps:
- powershell: echo 'Hello matrix'
@beachside-project
beachside-project / matrix.yml
Created June 30, 2023 00:53
Azure DevOps matrix sample
name: matrix1
stages:
- stage: matrix_demo
jobs:
- job: job_a
pool:
vmImage: ubuntu-latest
steps:
- powershell: |
@beachside-project
beachside-project / Startup.cs
Last active February 2, 2023 11:13
C# / Function App DI sample
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
[assembly: FunctionsStartup(typeof(DependencyInjectionWithHttpContextSample.Startup))]
namespace DependencyInjectionWithHttpContextSample;
public class Startup : FunctionsStartup
{
@beachside-project
beachside-project / aspnet-mvc-cicd.yml
Last active December 16, 2022 07:39
ASP.NET MVC (.NET Framework 4.8) to App Service
name: ASP.NET MVC (.NET Framework 4.8) to App Service
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
@beachside-project
beachside-project / sample.yml
Created October 3, 2022 12:25
GitHub Actions: Web API and APIM APIs CI/CD sample
name: Web API and APIM APIs CI/CD
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
permissions:
@beachside-project
beachside-project / Program.cs
Created September 28, 2022 15:04
specify version
using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
// バージョンの指定