Skip to content

Instantly share code, notes, and snippets.

@hitode909
hitode909 / Dockerfile.1.65
Last active January 22, 2026 05:29
DateTime::Format::W3CDTF Nanosecond Validation Bug
FROM perl:5.38
# Use Specio 0.49 (Specio 0.50+ has stricter integer validation)
RUN cpanm --notest Specio@0.49 && cpanm --notest DateTime@1.65 DateTime::Format::W3CDTF
WORKDIR /app
COPY test.pl .
CMD ["perl", "test.pl"]
#!/usr/bin/env ruby
# frozen_string_literal: true
# Claude Codeとの会話ログからコーディングルールを抽出してグローバルCLAUDE.mdに追記するスクリプト
#
# ## 目的
# Claude Codeとの過去の会話ログを分析し、コーディング指摘やベストプラクティスを
# 自動的に抽出してルール化することで、学習効果を継続・蓄積する
#
# ## アプローチ
@hitode909
hitode909 / find-unused-pm.md
Created November 11, 2025 02:20
~/.claude/commands/find-unused-pm.md
name description
find-unused-pm
到達可能性分析を使用してプロジェクト内の未使用のPerlパッケージ(.pmファイル)を見つける

未使用Perlパッケージの検出

このコマンドは以下の手順でプロジェクト内の未使用のPerlモジュールファイル(.pm)を見つけます:

  1. テンプレートをもとに、検出スクリプトを作成
  2. スクリプトを実行して未使用パッケージを検出
#!/usr/bin/env perl
# perldoc.jp用の未使用パッケージ検出スクリプト
use strict;
use warnings;
use File::Find;
use File::Spec;
# 設定(ハードコード)
my $BASE_DIR = '.';
my @ENTRY_POINTS = ('app.psgi');
// ==UserScript==
// @name Blog Dolphin for Hatena
// @namespace http://tampermonkey.net/
// @version 1.0
// @description はてなブログ編集画面で、ChatGPTが本文を批評してくれるイルカ
// @match https://blog.hatena.ne.jp/*
// @grant GM_registerMenuCommand
// @grant GM_xmlhttpRequest
// @grant GM_setValue
// @grant GM_getValue
@hitode909
hitode909 / desktop.1h.rb
Created January 19, 2024 15:44
Automatic Desktop Image Generator via OpenAI
#! /usr/bin/ruby
require 'net/http'
require 'json'
require 'uri'
require 'fileutils'
# Replace with your actual API key
API_KEY = ENV['OPENAPI_KEY']
def generate_theme
@hitode909
hitode909 / screen-capture.1m.rb
Created November 30, 2023 01:12
Continuous Screen Capture Script for xbar
#! /usr/bin/ruby
require 'logger'
require 'json'
LOGGER = Logger.new(STDOUT)
if ENV['DEBUG']
LOGGER.level = Logger::Severity::DEBUG
else
LOGGER.level = Logger::Severity::WARN
<p><button id="masawada-cast-button" style="display: none">masawada castを開始する</button>
<div id="masawada-cast-button-not-supported" style="display: none">お使いのブラウザは<a href="https://developer.mozilla.org/en-US/docs/Web/API/Presentation_API" target="_blank">Presentation API</a>に対応していないようです</div>
</p>
<script>
(function () {
const button = document.querySelector('#masawada-cast-button');
const error = document.querySelector('#masawada-cast-button-not-supported');
const show = function () {
button.style.display = 'block';
};
(() => {
const speak = (body, isRetry) => {
window.speechSynthesis.cancel()
if (!body) return;
console.log('speak ' + body);
const synth = window.speechSynthesis;
const allVoices = synth.getVoices();
const jaVoices = allVoices.filter(v => v.lang === 'ja-JP');
const voice = jaVoices[0];
if (!voice && !isRetry) {
@hitode909
hitode909 / crawl.js
Created December 23, 2018 20:40
つくりおきメトリクス
function crawl() {
var content = UrlFetchApp.fetch("https://tsukurioki.hatenablog.com/about").getContentText();
var entries = content.match(/(\d+) 記事/)[1];
var subscribers = content.match(/(\d+) 人/)[1];
Logger.log(subscribers);
var sheet = SpreadsheetApp.openById("*************************").getSheetByName('data');
var newRow = [new Date(), +entries, +subscribers];
sheet.appendRow(newRow);
}