Skip to content

Instantly share code, notes, and snippets.

View guitarrapc's full-sized avatar
:octocat:

Ikiru Yoshizaki guitarrapc

:octocat:
View GitHub Profile
@guitarrapc
guitarrapc / HatenaBlogContentToDraft.cs
Last active March 29, 2025 06:05
HatenaBlog Content copy to draft_entries, if draft title is same as customPath
var draftBasePath = @"{YOUR_GITHUB_PATH}/blogdraft_entries\";
var basePath = @"{YOUR_GITHUB_PATH}/entries/{YOUR_ACCOUNT}.hatenablog.com/entry/";
var targetMonths = new[] {
// 持ってきたい日付を並べる
"2025/03"
};
var titlePattern = new Regex("201[2,3]/[0-9]{2}/[0-9]{2}/[0-9]{6}", RegexOptions.Compiled);
var drafts = Directory.EnumerateFiles(draftBasePath, "*.md");
foreach (var draft in drafts)
@guitarrapc
guitarrapc / Markdown_sample.txt
Created March 1, 2025 20:54
Test markdown output with common format
マークダウンの表示用テキスト
# 見出し1
## 見出し2
### 見出し3
#### 見出し4
@guitarrapc
guitarrapc / Program_v4.cs
Last active February 5, 2025 11:23
ConsoleAppFramework v5 cannot handle parameter not defined in method. v4 can do it.
// ConsoleAppFramework v4
using ConsoleAppFramework;
// # OK
// # Output: foo
// args = ["--msg", "foo"];
// # OK
// # Output: foo--hello bar
@guitarrapc
guitarrapc / Program.cs
Last active January 20, 2025 03:52
Export NuGet Packages referenced in C# Solution, then list Licenses.
using System.Collections.Concurrent;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Xml.Linq;
var path = @"output.json";
var bytes = File.ReadAllText(path);
var packages = JsonSerializer.Deserialize<DotnetCliListPackages>(bytes);
ArgumentNullException.ThrowIfNull(packages);
var licenses = new ConcurrentBag<DotnetLicense>();
@guitarrapc
guitarrapc / README.md
Last active January 14, 2025 18:07
Remove "Open with Visual Studio" in the Windows Explorer Context menu

Summy

There are 2 registry keys you need to remove.

  • HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode
  • HKEY_CLASSES_ROOT\Directory\shell\AnyCode

Steps

Step1. Check you value before deletetion

@guitarrapc
guitarrapc / run.sh
Created December 9, 2024 05:40
run terraform-graph-beautifier.
#!/bin/bash
set -euo pipefail
terraform graph -type=apply | docker run --rm -i --name terraform-graph-beautifier ghcr.io/pcasteran/terraform-graph-beautifier:latest-linux --embed-modules=false --output-type=cyto-html > config1.html
@guitarrapc
guitarrapc / Program.cs
Last active December 4, 2024 06:30
Amazon Aurora DSQL connect from C# by Npgsql
using System;
using System.Linq;
using System.Text;
using Amazon;
using Amazon.Runtime;
using Amazon.Runtime.CredentialManagement;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Util;
using Npgsql;
@guitarrapc
guitarrapc / README.md
Last active November 26, 2024 09:16
Clean up specified workflow run history
mkdir ./run && cd ./run
# copy files into directory...
npm install octokit
node ./app.js
@guitarrapc
guitarrapc / ホロキュアキュア.md
Last active November 18, 2024 16:48
ほろきゅあおすすめビルド

武器1つのクリア用安定ビルド

アイテム

  1. 防御: 抱き枕 -> シールド
  2. 防御: ヘッドホン -> 35%回避
  3. 火力: お菓子の国のスイーツ -> ATK75%になるが3倍ヒット
  4. 移動: エナジードリング (スピード+ヘイスト) -> スピードが300%いくと安定 4'. 勉強眼鏡
  5. 火力: 集中グラサン (射撃/連射武器用) -> クリティカル500%ダメージ
@guitarrapc
guitarrapc / list_scheduled_workflow.sh
Last active August 30, 2024 13:38
List GitHub Actions workflow which has on.schedule
#/bin/bash
set -euo pipefaiil
echo "| Name | Path | Schedule (UTC) |"
echo "| ---- | ---- | ---- |"
json=$(gh workflow list --json name,path,state --limit 300)
echo "$json" | jq -c '.[] | select(.state == "active") | {name: .name, path: .path}' | sort | while read -r item; do
name=$(echo "$item" | jq -r '.name')
path=$(echo "$item" | jq -r '.path')
if [[ ! -f "$path" ]]; then continue; fi