Skip to content

Instantly share code, notes, and snippets.

View the9ball's full-sized avatar

Shoichi Yasui the9ball

View GitHub Profile
@the9ball
the9ball / LocalDebug.cs
Created June 11, 2025 09:20
LocalDebug
using System.Runtime.CompilerServices;
// using static Local.LocalDebug;
namespace Local
{
public static class LocalDebug
{
public static void TraceLine([CallerFilePath] string path = "", [CallerMemberName] string method = "", [CallerLineNumber] int line = 0)
{
@the9ball
the9ball / GetPFCFromHealthConnect.linq
Created June 9, 2025 08:52
ヘルスコネクトからPFCデータを取ってくる
<Query Kind="Program">
<NuGetReference>System.Data.SQLite.Core</NuGetReference>
<Namespace>System.IO.Compression</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
<Namespace>System.Data.SQLite</Namespace>
<Namespace>System.Runtime.CompilerServices</Namespace>
</Query>
// Need Packages
// System.Data.SQLite.Core
@the9ball
the9ball / Dockerfile
Created July 17, 2024 12:15
bootstrap.shでexecすればいけるかどうか確認
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
COPY ./bootstrap.sh ./
COPY ./output/* ./
CMD ["bash", "bootstrap.sh"]
@the9ball
the9ball / Program.cs
Created December 22, 2023 09:59
C# Advent Calendar 2023 : Benchmark2
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<Runner>();
record struct KVPString(int Key, int Value)
{
public override string ToString() => $"{Key:000000} : {Value}";
}
クロネコヤマト ヤマト運輸の場合
http://jizen.kuronekoyamato.co.jp/jizen/servlet/crjz.b.NQ0010?id=
佐川急便の場合
http://k2k.sagawa-exp.co.jp/p/web/okurijosearch.do?okurijoNo=
ゆうパックの場合
http://tracking.post.japanpost.jp/service/singleSearch.do?org.apache.struts.taglib.html.TOKEN=&searchKind=S002&locale=ja&SVID=&reqCodeNo1=
dotnet script %~dp0hoge.csx 5 && echo success || echo error
@the9ball
the9ball / a.cs
Last active June 29, 2021 01:32
Subscribe Task
using ConsoleAppFramework;
using System;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Threading.Tasks;
namespace ConsoleApp1
{
static class Ex
{
@the9ball
the9ball / all.sh
Created December 3, 2020 09:37
all.sh
#!/bin/bash
#set -eu
targets=$(find . -name ".git" | sed -e 's/^\.\/\(.*\)\/.git$/\1/')
temp=${*:-st}
IFS=, eval 'arr=($temp)'
for command in "${arr[@]}"; do
echo "===="
echo "DO \"${command}\""
@the9ball
the9ball / a.cs
Last active August 8, 2018 09:00
AWS Cloudwatch Logs からログを全部取ってくるやつ @ LinqPad
readonly RegionEndpoint Region = RegionEndpoint.APNortheast1;
readonly AWSCredentials Credentials = new BasicAWSCredentials();
const string LogGroupName = "";
const string LogStreamName = "";
async Task Main()
{
using (var cts = new CancellationTokenSource(TimeSpan.FromMinutes(30))) // 念のため
using (var client = new AmazonCloudWatchLogsClient(Credentials, Region))
@the9ball
the9ball / コンストラクタを呼ばずにインスタンスを作る.cs
Last active March 29, 2018 06:08
コンストラクタを呼ばずにインスタンスを作る
T Create<T>() => (T)FormatterServices.GetUninitializedObject(typeof(T));