Skip to content

Instantly share code, notes, and snippets.

chrome://history/ のチェックボックスを一括選択する方法 by ChatGPT

DevTools 「Snippets」で保存して使い回す

同じコードを毎回ペーストするのは面倒なので、 Chrome に元から入っている Snippets 機能を使うのがいちばん楽です。

Snippet を作る手順(最初に1回だけ)

  1. chrome://history/ を開く
  2. F12 で DevTools を開く
@koki-h
koki-h / JPGのみ選択.workflow.md
Created April 27, 2025 03:01
Finderで選択したファイルを右クリックして「.JPG/.jpgだけを選択し直す」

📄 Finderで選択したファイルから「.JPG/.jpgだけを選択し直す」クイックアクション作成手順まとめ


【目的】

  • Finderで複数ファイルを選択
  • その中から「拡張子が.jpgまたは.JPG」のファイルだけを自動的に選択状態にする

@koki-h
koki-h / .zshrc
Created April 7, 2025 09:27
Cursorがファイルの行末にスペースをくっつけるので簡単に削除できるコマンドを作った。
# ディレクトリにsedをかける。バイナリファイルは無視する
function sed_safe() {
find "$1" -type f -exec file {} \; | grep ':.*text' | cut -d: -f1 | xargs sed -i '' "$2"
}
# ディレクトリ内のファイル行末の空白を削除する
function trim_tail() {
sed_safe "$1" 's/[[:space:]]*$//'
}
@koki-h
koki-h / collatz.rb
Last active September 4, 2021 07:59
任意の自然数maxまでの自然数についてコラッツ予想が正しいかを確かめるプログラム
# 任意の自然数maxまでの自然数についてコラッツ予想が正しいかを確かめるプログラム
# 収束しない値(予想に反する値)が現れた場合はスタックオーバーフローでエラーになる。(とはいえスタックが足りないだけでいつか収束するのかもしれない。)
# コラッツ予想とは
# 「どんな正の整数も、偶数なら2で割り、奇数なら3倍して1を足す。この操作を繰り返せば、必ず最後は1になるだろう」
# see: https://digital.asahi.com/articles/ASP937HM6P8ZULBJ00T.html
require 'tempfile'
def collatz(n)
$tempio.print n
if (n % 2) == 0
@koki-h
koki-h / get_download_link.js
Last active July 30, 2021 04:17
違法アップロードサイトからダウンロードリンクを抽出する
@koki-h
koki-h / vaccine.rb
Last active June 4, 2021 15:16
ワクワクチンチンが出るまでランダムに"ワ","ク","チ","ン"を出す
# inspired by https://anond.hatelabo.jp/20210604154733
CHAR_BOX=%w|ワ ク チ ン|
TARGET_STR="ワクワクチンチン"
current_str_a = []
current_str = ""
while true do
current_str_a.shift if current_str_a.size >= TARGET_STR.size
c = CHAR_BOX.sample
current_str_a << c
@koki-h
koki-h / Vagrantfile
Last active June 18, 2020 04:18
Plastic Rails( https://github.com/koki-h/plastic_rails )のデバッグ用Virtualboxを作成するVagrantfile。ruby, bundler, docker (compose)が最初から入る。
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", inline: <<-SHELL
apt-get install ruby -y
gem install bundler
curl -fsSL https://get.docker.com -o get-docker.sh
@koki-h
koki-h / Vagrantfile
Created May 28, 2020 10:30
docker-compose が最初から動くVagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", inline: <<-SHELL
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
usermod -aG docker vagrant
@koki-h
koki-h / semaphore.js
Created May 18, 2020 04:06 — forked from gregkorossy/semaphore.js
A simple implementation of a semaphore in JS
function Semaphore(max) {
var counter = 0;
var waiting = [];
var take = function() {
if (waiting.length > 0 && counter < max){
counter++;
let promise = waiting.shift();
promise.resolve();
}
@koki-h
koki-h / semaphore.js
Last active May 18, 2020 04:06 — forked from gregkorossy/semaphore.js
A simple implementation of a semaphore in JS
function Semaphore(max) {
// 排他制御のためのセマフォ
// https://gist.github.com/Gericop/e33be1f201cf242197d9c4d0a1fa7335
var counter = 0;
var waiting = [];
var take = function() {
if (waiting.length > 0 && counter < max){
counter++;