Skip to content

Instantly share code, notes, and snippets.

View nenoNaninu's full-sized avatar
🍌
wi(l)d-screen baroque

nenoNaninu nenoNaninu

🍌
wi(l)d-screen baroque
View GitHub Profile
@nenoNaninu
nenoNaninu / HttpMessageHandlerActivityOvserver.cs
Last active March 21, 2024 16:57
HttpMessageHandlerActivityOvserver.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Extensions.Logging;
namespace MyService.Diagnostics;
class HttpMessageHandlerActivityOvserver : IObserver<DiagnosticListener>
{
private readonly ILogger<HttpMessageHandlerActivityOvserver> _logger;
@nenoNaninu
nenoNaninu / formatter_does_not_work.cs
Created August 13, 2022 08:44
formatter_does_not_work.cs
using System.Globalization;
public class C1
{
public int Value { get; init; }
}
class C2
{
private readonly C1 _instance = new C1()
@nenoNaninu
nenoNaninu / release.yaml
Last active October 28, 2021 04:08
GitHub Actions script for push nuget packages
name: release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
jobs:
release:
runs-on: ubuntu-latest
@nenoNaninu
nenoNaninu / Makuhiki.cs
Last active October 22, 2021 17:17
Makuhiki
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Makuhiki;
public static class Exit
{
public static Task WaitAsync()
{
@nenoNaninu
nenoNaninu / .editorconfig
Last active March 16, 2022 23:06
.editorconfig
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Don't use tabs for indentation.
[*]
indent_style = space
charset = utf-8
end_of_line = lf
@nenoNaninu
nenoNaninu / BlogAuthenticationJwt.cs
Last active September 1, 2021 08:04
BlogAuthenticationJwt.cs
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Security.Cryptography;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
@nenoNaninu
nenoNaninu / TypedSignalR.Client.Blog01.cs
Last active June 25, 2021 05:52
TypedSignalR.Client_Blog
interface IClientContract
{
Task SomeClientMethod1(string user, string message);
Task SomeClientMethod2();
}
interface IHubContract
{
Task<string> SomeHubMethod1(string user, string message);
Task SomeHubMethod2();
@nenoNaninu
nenoNaninu / visualize_occupancy.py
Created July 29, 2020 18:23
visualize occupancy
import numpy as np
import open3d as o3d
points_dict = np.load("points.npz")
points = points_dict['points']
if points.dtype == np.float16:
points = points.astype(np.float32)
points += 1e-4 * np.random.randn(*points.shape)
else:
@nenoNaninu
nenoNaninu / Yielder.cs
Created June 6, 2020 17:35
C# awaitおもしろコード
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace ConsoleApp2
{
public static class EnumerableEx
{
public static IEnumerable<T> Create<T>(Action<IYielder<T>> create)
{
@nenoNaninu
nenoNaninu / GenericsSpeedTest.cs
Last active August 7, 2019 15:51
Genericsのほうが早んだけど!?
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace GenericsSpeedTest
{
static class Program
{
static int BiggerInt(int i, int j)
{