Skip to content

Instantly share code, notes, and snippets.

View cocoabox's full-sized avatar

cocoabox cocoabox

View GitHub Profile
@cocoabox
cocoabox / redliver.sh
Created March 7, 2025 06:51
クロネコヤマト自動再配達依頼
#!/bin/bash
# ---
# クロネコヤマト自動再配達依頼
#
# usage : bash redliver.sh [伝票番号] [個人情報ENVファイル]
#
# ---
# 2025-03-07 : initial version
# ---
@cocoabox
cocoabox / kuroneko-yamato-tracking.js
Created March 6, 2025 12:58
クロネコヤマトの配達状況をJSONで出力する
//
// 使い方: node kuroneko-yamato-tracking.js [伝票番号] | jq
// OR : const kuroneko_yamato_tracking = reuqire('./kuroneko_yamato_tracking');
// const tracking_info_dict = await kuroneko_yamato_tracking('0000-0000-0000');
//
const cheerio = require('cheerio');
async function kuroneko_yamato_tracking(tracking_number) {
tracking_number = tracking_number.trim().replaceAll(/[\-]/g, '');
try {
@cocoabox
cocoabox / fritzing-build-prep.sh
Last active December 7, 2024 16:38
prepare fritzing-1.4.0 for build on macOS ventura
#!/bin/bash
#
# macos ventura-13.5
# fritzing-1.4.0
#
fritzing_app__repo="[email protected]:cocoabox/fritzing-app.git"
fritzing_parts__repo="[email protected]:cocoabox/fritzing-parts.git"
fritzing_app__commit_id="a8c6ef7cf66f7a42b9b233d6137f1b70a9573a25"
fritzing_parts__commit_id="76235099ed556e52003de63522fdd74e61d53a36"
@cocoabox
cocoabox / nostalgic-dos-text-ui.md
Last active September 30, 2024 13:09
nostalgic text UI (TUI) in DOS

tl;dr

Because I love TextUI, and TextUI in DOS is beautiful and technically non-trivious, I have gathered some information on the internet, and I want to write a small summary of familiar "frameworks" I encountered, their aesthetics and some technical details if available.

While there are many TextUIs, I focus on mainly aesthetics/frameworks that are used by more than one products.

Table of Contents

@cocoabox
cocoabox / UIASM.OBJ.base64
Last active May 27, 2024 16:34
build uidemo.bas from BASIC 7.1
gAsACXVpYXNtLmFzbd6WKgAAClVJQVNNX1RFWFQFX0RBVEEGREdST1VQBV9URVhUBERBVEEEQ09ERdiYBwBIAAAFBwEMmAcASA8AAwYBAJgHAEj/AQIHAQ+aBAAE/wJdjBAADVNUUklOR0FERFJFU1MAepBFAAADCmdldGNvcHlib3goAAAJZ2V0X21lbXh5FwAACmdldF9zY3JzZWcAAAAKcHV0Y29weWJveNgAAAdhdHRyYm94ZwEA4YgEAACiAdGgAwIDAABQtA/NEMcGAAAAuDwHdQbHBgAAALBYy1JQsqD24lqK1rYAAtIDwlrLVYvsHgZWV4teDosHogAAi14MiweiAACLXgqLB6IAAIteCIsHogAAi14GU5oAAAAAowAAiRYAAP4OAAD+DgAA/g4AAP4OAAAO6I3/oAAAKgYAAKIAAAQBtACjAACgAAAqBgAAogAAjgYAAIs+AAC+AACkvgAApKAAAIomAAAO6G7/i/CLDgAAHo4eAADzpR+BxqAAKzYAACs2AACAPgAAAHQG/g4AAOvbX14HH13KCgBVi+weBlZXi14KiweiAACLXgiLB6IAAIteBlOaAAAAAKMAAIkWAAD+DgAA/g4AAA7o9f4eB4s2AAAejh4AAL8AAKS/AACkH6AAAAQBtACjAACKJgAAoAAADujj/ov4jgYAAIsOAAAejh4AAPOlH4HHoAArPgAAKz4AAIA+AAAAdAb+DgAA69tfXgcfXcoGAFWL7B4GVleLXg6LB6IAAIteDIsHogAAi14KiweiAACLXgiLB6IAAIteBosHogAA/g4AAP4OAAD+DgAA/g4AAA7oVv6gAAAqBgAA/sAy5KMAAKAAACoGAACiAACgAACKJgAADuhK/ov4jgYAAKAAAIsOAABHquL8gcegACs+AAArPgAAgD4AAAB0Bv4OAADr319eBx9dygoALZwZAsQHEAECCwDEERABAgsAxDUQAQICAMQ9EAECAQDERRABAgQAxE0QAQIDAMxUVgHEWRABAgcA
@cocoabox
cocoabox / google2duckduckgo.js
Created November 20, 2023 05:56
google 検索結果を duckduckgo に変換するBookmarklet
javascript:(function() { var currentUrl = window.location.href; var searchQueryMatch = currentUrl.match(/q=([^&]+)/); if (searchQueryMatch && searchQueryMatch[1]) { var decodedSearchQuery = decodeURIComponent(searchQueryMatch[1].replace(/\+/g, ' ')); var duckDuckGoUrl = 'https://duckduckgo.com/?t=h_&q=' + encodeURIComponent(decodedSearchQuery); window.location.href = duckDuckGoUrl; } else { window.location.href = 'https://duckduckgo.com/'; } })();
@cocoabox
cocoabox / steal-synopsis-from-amazon-prime-video.js
Created January 11, 2023 16:37
steal-synopsis-from-amazon-prime-video.js
(async function(){
const series_title = document.querySelector('[data-automation-id="title"]')?.innerText.trim();
const series_synop = document.querySelector('[data-automation-id="atf-synopsis"]')?.innerText.trim();
const li_arr = document.querySelectorAll('[id^="av-ep-episodes"]');
let episodes = [];
for (const li of li_arr) {
const title_elem = li.querySelector('[data-automation-id^="ep-title-episodes-"]');
const title_all = title_elem.innerText.trim();
const title_mat = title_all.match(/^([0-9]+)\.*\s*(.*)$/);
@cocoabox
cocoabox / youtube-audio.sh
Last active September 12, 2022 05:31
Download youtube music videos or playlist (with static album art) into m4a file with embedded album art. Requires ffmpeg, AtomicParsley, yt-dlp
#!/bin/bash
if [[ -z "$1" ]]; then
echo "usage : $0 [YOUTUBE_URL_OR_ID]" >&2
exit 1
fi
OK=1
ffmpeg >/dev/null 2>/dev/null
if [[ $? -eq 127 ]]; then
echo "ffmpeg is required : https://ffmpeg.org/download.html" >&2
@cocoabox
cocoabox / twitter-not-interested-bookmarklet.js
Created May 5, 2022 15:37
twitter-not-interested-bookmarklet.js
javascript: void((function() { function disableInterests(doc) { function findSpanText(checkbox) { let elem = checkbox.parentElement; let levels = 0; while (elem && levels < 10) { let span = elem.querySelector('span'); if (span) { return span.textContent; } elem = elem.parentElement; levels++; } } let wait_ms = 100; let checkboxes = doc.querySelectorAll("div > input[type='checkbox']:checked"); let len = checkboxes.length; let done = 0; let inc = 50; checkboxes.forEach((interest) => { console.log(interest); let text = findSpanText(interest); setTimeout(function() { done++; let msg = `(${done}/${len}) ` + (text ? text : '(unknown)'); console.log(msg); doc.title = msg; interest.scrollInt
@cocoabox
cocoabox / fetlife-convert-all-photos-to-private.js
Last active July 12, 2020 10:36
batch convert all FetLife photos to private
// fetLife batch change all photos to private ("friends only")
//
// usage:
//
// 1. open your first photo , URL should be https://fetlife.com/users/xxxxx/pictures/yyyyy
// 2. copy paste this code to your Javascript console and hit Return
// - a new tab (window) will open; do not close this tab
// - to terminate the process, close the newly-opened tab, then reload the current window/tab
// 3. this script doesn't work all the time; to make sure every pic is now private, repeat 1~2 again
//