This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| # perldoc.jp用の未使用パッケージ検出スクリプト | |
| use strict; | |
| use warnings; | |
| use File::Find; | |
| use File::Spec; | |
| # 設定(ハードコード) | |
| my $BASE_DIR = '.'; | |
| my @ENTRY_POINTS = ('app.psgi'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <script> | |
| var current = { x: 0.0, y: 0.0, z: 0.0 }; | |
| window.addEventListener("MozOrientation", | |
| function(data) { | |
| var xyz = ['x', 'y', 'z']; | |
| for(var i = 0;i<xyz.length;i++){ | |
| var sum = Math.abs(data.x) + Math.abs(data.y) + Math.abs(data.z); | |
| if (data[xyz[i]] > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name simple twitter | |
| // @namespace http://www.hatena.ne.jp/hitode909/ | |
| // @description make posts simple. | |
| // @include http://twitter.com/* | |
| // @require http://code.jquery.com/jquery-latest.js | |
| // ==/UserScript== | |
| (function(){ | |
| $('li.status').each(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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'; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (() => { | |
| 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env ruby | |
| # Copy random LGTM to clipboard | |
| require 'open-uri' | |
| require 'nokogiri' | |
| require 'shellwords' | |
| doc = Nokogiri open('http://www.lgtm.in/g') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # Create a animation of of a rotating image. | |
| # Some alpha composition is used to crop the result to the original size. | |
| # | |
| command="convert -delay 10 $1 -resize 50% -trim +repage -bordercolor white" | |
| command="$command \\( +clone -border 1x1 -fill lightsteelblue" | |
| command="$command -colorize 100% \\) -gravity center" | |
| for i in `seq 100 -2 20 ;`; do |
NewerOlder