Skip to content

Instantly share code, notes, and snippets.

View shuuji3's full-sized avatar
๐ŸŒˆ
๐ŸŒŽ ๐ŸŒŸ ๐Ÿฆš ๐ŸŒŒ โœจ

TAKAHASHI Shuuji shuuji3

๐ŸŒˆ
๐ŸŒŽ ๐ŸŒŸ ๐Ÿฆš ๐ŸŒŒ โœจ
View GitHub Profile
@shuuji3
shuuji3 / calculate-youtube-watch-later.js
Last active March 27, 2025 09:07
Calculate times of your YouTube "Watch later" list
// usage:
// 1. open "Watch later" page: https://www.youtube.com/playlist?list=WL
// 2. scroll down to the bottom of the queue
// 3. run this in the console
function toSec(str) {
let [h, m, s] = str.split(':').map((head, _) => parseInt(head))
if (!s) {
s = m
m = h
h = 0
@shuuji3
shuuji3 / vitejs-docs-ja-start-new-pr.fish
Last active December 24, 2024 07:01
fish shell script for contributing Vite documentation Japanese translation https://github.com/vitejs/docs-ja
#!/usr/bin/env fish
# Parse args
if count $argv > /dev/null
set issue $argv[1]
else
read -p 'set_color green; echo -n "Issue number"; set_color normal; echo "> "' issue
end
# Create a new branch
@shuuji3
shuuji3 / bronze-1F308.png
Last active March 27, 2023 00:41
Adopted Emoji โœจ
bronze-1F308.png
@shuuji3
shuuji3 / find_key_diff.py
Last active February 17, 2023 09:08
Print out the differences of JSON keys to detect the Elk's localization update.
# Print out the differences of JSON keys to detect the Elk's localization update.
import json
def recursive_items(dictionary, prefix=''):
for key, value in dictionary.items():
if type(value) is dict:
yield (f'{prefix}{key}', value)
yield from recursive_items(value, prefix=f'{key}.')
else:
@shuuji3
shuuji3 / introduction-to-geopandas.ipynb
Last active August 26, 2022 14:39
introduction-to-geopandas.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shuuji3
shuuji3 / 2022-08-11-chiba-prefecture-covid-19-cases-by-city.ipynb
Created August 15, 2022 10:06
2022-08-11 chiba prefecture covid-19 cases by city.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shuuji3
shuuji3 / code.gs
Created February 4, 2022 01:18
Google Books API ใ‚’ไฝฟใฃใฆๆ›ธ็ฑๆƒ…ๅ ฑใฎ JSON ใ‚’ๅ–ๅพ—ใ™ใ‚‹ใ‚นใ‚ฏใƒชใƒ—ใƒˆ
/**
* Google Books API ใ‚’ไฝฟใฃใฆๆ›ธ็ฑๆƒ…ๅ ฑใฎ JSON ใ‚’ๅ–ๅพ—ใ™ใ‚‹ใ€‚
*
* @param {string} isbn - ๆ›ธ็ฑใฎ ISBN
* @return {object}
*
* @see Using the API  |  Google Books APIs  |  Google Developers
* - https://developers.google.com/books/docs/v1/using#PerformingSearch
* @see Error: "Cannot determine user location for geographically restricted operation."
* - Google ใƒ—ใƒญใƒ€ใ‚ฏใƒˆ ใƒ•ใ‚ฉใƒผใƒฉใƒ  - https://productforums.google.com/forum/#!msg/books-api/cK8VJUhRl9w/rx-8HPDy8FIJ
@shuuji3
shuuji3 / output.jsonl
Last active November 3, 2021 08:16
Temporary solution for `mas list --json`. ref. Add option for retrieving information in JSON format ยท Issue #190 ยท mas-cli/mas - https://github.com/mas-cli/mas/issues/190
{"id": 497799835, "name": "Xcode (13.1)"}
{"id": 1423210932, "name": "Flow (2.7.5)"}
{"id": 1452453066, "name": "Hidden Bar (1.8)"}
{"id": 1475387142, "name": "Tailscale (1.16.1)"}
@shuuji3
shuuji3 / montage-go-mochi.py
Created September 15, 2021 03:32
Run `montage` commands to create go-mochi 4 bits counters.
# Run `montage` commands to create go-mochi 4 bits counters.
import subprocess
import itertools
mochi_bit = ['mochi-dark2.png', 'mochi.png']
bits_list = itertools.product((0, 1), (0, 1), (0, 1), (0, 1))
# => [(0, 0, 0, 0), (0, 0, 0, 1), ...]
for bits, n in zip(bits_list, range(16)):