SPDX-FileCopyrightText: Copyright (c) 2025 TwoSquirrels
SPDX-License-Identifier: MIT
りすりす/TwoSquirrels が WSH 用にまとめた、Web サイトチューニングのチェックリストです。このリストの項目を 1 つずつ対応していけば、機械的にある程度チューニングができるはずです。ご自由にお使いください!(WSH 用なので、キャッシュ周りについては省いています)
- 環境構築はできていますか?
SPDX-FileCopyrightText: Copyright (c) 2025 TwoSquirrels
SPDX-License-Identifier: MIT
りすりす/TwoSquirrels が WSH 用にまとめた、Web サイトチューニングのチェックリストです。このリストの項目を 1 つずつ対応していけば、機械的にある程度チューニングができるはずです。ご自由にお使いください!(WSH 用なので、キャッシュ周りについては省いています)
| -- SPDX-FileCopyrightText: 2025 TwoSquirrels | |
| -- SPDX-License-Identifier: Apache-2.0 | |
| local qrencode = dofile("luaqrcode/qrencode.lua") | |
| --- Generate a QR code matrix with padding. | |
| --- @param text string the text to encode | |
| --- @return boolean[][]|nil matrix the QR code matrix or nil if failed | |
| local function qrcode(text) | |
| local ok, tab = qrencode.qrcode(text) |
| # energy | |
| # oneline: curl -s 'http://agora.ex.nii.ac.jp/earthquake/201103-eastjapan/energy/electrical-japan/info.json' | jq '[.tokyo.time, .tokyo.percentage][]' | tr '\n' ' ' | xargs -n2 bash -c 'echo "$0 現在、東京電力の供給量に対する電力使用率は $1% です"' | |
| function energy() { | |
| error=0 | |
| url='http://agora.ex.nii.ac.jp/earthquake/201103-eastjapan/energy/electrical-japan/info.json' | |
| json=$(curl --silent --max-time 2 "$url" || error=1) | |
| [ -z "$json" ] && error=1 | |
| [ $error -ne 0 ] && { | |
| echo '電気使用率が取得できませんでした' | |
| return 1 |
| // SPDX-License-Identifier: MIT | |
| "use strict"; | |
| const tabletojson = require("tabletojson").Tabletojson; | |
| console.log( | |
| `\n### AJL2023 高3 個人ランキング (${new Date().toLocaleDateString()}時点)\n` | |
| ); |
| // SPDX-License-Identifier: CC0 | |
| package io.github.twosquirrels.simplegrapplinghook; | |
| import org.bukkit.ChatColor; | |
| import org.bukkit.Location; | |
| import org.bukkit.command.Command; | |
| import org.bukkit.command.CommandSender; | |
| import org.bukkit.entity.FishHook; | |
| import org.bukkit.entity.Player; |
This bookmarklet downloads up to four images from a Twitter page, and names them based on the username, tweet ID, and image number. It only works on Twitter pages and will throw an error if run on a different website.
javascript:(async()=>{if(location.hostname.match(/\.?twitter\.com$/)){let[,t,,e]=location.pathname.split("/");return[...document.getElementsByTagName("img")].filter(t=>t.src.startsWith("https://pbs.twimg.com/media/")).slice(0,4).map((a,c)=>({url:a.src.replace(/&name=.+/,""),name:`Title-twitter-${t}-${e}-${c+1}.jpg`}))}throw Error("This page is not supported.")})().then(t=>t.forEach(async({url:t,name:e})=>{let a=document.createElement("a");a.href=URL.createObjectURL(await (await fetch(t,{mode:"cors"})).blob()),a.download=e,a.click()})).catch(t=>alert(t))| #! /usr/bin/env node | |
| // SPDX-License-Identifier: MIT | |
| // (C) 2022 TwoSquirrels | |
| // exports | |
| module.exports = minifyBrainfuck; | |
| // parse command line arguments | |
| const [, thisFilePath, ...args] = process.argv; | |
| if (require.main === module) { |