Skip to content

Instantly share code, notes, and snippets.

View beachside-project's full-sized avatar
😄

Atsushi YOKOHAMA beachside-project

😄
View GitHub Profile
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();
// バージョンの指定
@beachside-project
beachside-project / Program.cs
Created September 28, 2022 14:55
default Prgram.cs
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();
builder.Services.AddSwaggerGen();
var app = builder.Build();
@beachside-project
beachside-project / Function1.cs
Created December 17, 2021 08:02
Function app default code
public static class Function1
{
[FunctionName("Function1")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
string name = req.Query["name"];
@beachside-project
beachside-project / local.settings.json
Created July 7, 2021 17:06
Azure Functions logLevel override sample
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"AzureFunctionsJobHost__logging__logLevel__Default": "Trace"
}
}