Skip to content

Instantly share code, notes, and snippets.

@sakuro
sakuro / active-mods.lua
Last active January 13, 2023 04:13
Active mods
game.write_file("active-mods.md", "| Mod | Version |\n")
game.write_file("active-mods.md", "|-|-:|\n", true)
for name, version in pairs(script.active_mods) do
game.write_file("active-mods.md", string.format("| %s | %s |\n", name, version), true)
end
end
@sakuro
sakuro / gist:221a8f014ee778eea131839f3d802e24
Created January 5, 2022 13:36
Web版デレぽのテキストを選択可能にするブックマークレット
javascript:%5B...document.querySelectorAll('.text')%5D.forEach((p)%3D>%7Bp.style.userSelect%3D'text'%3B%7D)%3B
@sakuro
sakuro / imasbbs-block-system.js
Last active December 19, 2021 09:31
IMASBBS Block System
// ==UserScript==
// @name IMASBBS Block System
// @namespace http://tampermonkey.net/
// @version 0.1
// @description IMASBBSのIDブロック機能を改良します。
// @author sakuro
// @match http://imasbbs.com/patio.cgi*
// @icon https://www.google.com/s2/favicons?domain=imasbbs.com
// @grant none
// ==/UserScript==
@sakuro
sakuro / mapshot-concat.sh
Last active April 16, 2021 11:53
Concatenate images generated by mapshot (Factorio MOD)
#!/bin/sh -ue
# mapshot-concat.sh map-xxxxxxxx/d-xxxxxxxx/zoom_x output.jpg
if [ -n "$WSL_DISTRO_NAME" ]; then
# WSL1/2
FACTORIO_DIR="/mnt/c/Users/$USER/AppData/Roaming/Factorio"
elif [ "$(uname -o)" = Darwin ]; then
# macOS
FACTORIO_DIR="$HOME/Library/Application Support/Factorio"
@sakuro
sakuro / random-dots.html
Created November 18, 2017 08:33
Random dots and non-random dots
<!DOCTYPE html>
<html>
<head>
<title>Random Plot</title>
<style>
canvas { border: solid 1px; }
th { font-family: monospace; }
</style>
</head>
<body>
@sakuro
sakuro / bulma-delete.js
Last active May 21, 2018 01:33
Bulmaの .delete を子に持つなにか(たとえば .notification)を削除
document.querySelectorAll('.delete').forEach((elm) => {
elm.addEventListener('click', (ev) => {
const target = ev.target.closest('.notification');
if (target) {
target.parentNode.removeChild(target);
}
});
});