Skip to content

Instantly share code, notes, and snippets.

View KOBA789's full-sized avatar
🚀

KOBA789 KOBA789

🚀
View GitHub Profile
@KOBA789
KOBA789 / e.js
Created November 3, 2024 01:53
e.js
function E (tagName, attrs, children) {
const el = document.createElement(tagName);
attrs = attrs || {};
Object.keys(attrs).forEach(function (key) {
el.setAttribute(key, attrs[key]);
});
for (let child of children) {
if (child instanceof Node) {
el.appendChild(child);
} else {
class CollapsedQueue<K, V> {
private jobs: Map<K, V> = new Map();
constructor(
private timeout: number,
private collapse: (oldValue: V, newValue: V) => V,
private doJob: (key: K, value: V) => void,
) {}
enqueue(key: K, value: V) {
@KOBA789
KOBA789 / misskey-io-share.js
Created August 4, 2023 08:22
見てるページをMisskey.ioにシェアするブックマークレット
javascript:(()=>{var u=new URL('https://misskey.io/share');u.searchParams.append('text', `${document.title}: ${location.href}`);window.open(u.toString())})();void(0);
@KOBA789
KOBA789 / serial-binary-adder.zse
Created June 25, 2022 12:43
https://zuse.koba789.com/ で使える直列加算機の回路です
{"wires":{"root":{"children":[{"Parent":{"children":[{"Parent":{"children":[{"Leaf":{"from":[650,150],"to":[650,200]}},{"Leaf":{"from":[400,200],"to":[400,250]}},{"Leaf":{"from":[200,200],"to":[200,250]}},{"Leaf":{"from":[650,200],"to":[650,250]}},{"Leaf":{"from":[200,200],"to":[400,200]}},{"Leaf":{"from":[400,200],"to":[650,200]}}],"envelope":{"lower":[200,150],"upper":[650,250]}}},{"Parent":{"children":[{"Leaf":{"from":[400,750],"to":[400,800]}},{"Leaf":{"from":[650,750],"to":[650,800]}},{"Leaf":{"from":[200,750],"to":[200,800]}},{"Leaf":{"from":[650,800],"to":[650,850]}},{"Leaf":{"from":[200,800],"to":[400,800]}},{"Leaf":{"from":[400,800],"to":[650,800]}}],"envelope":{"lower":[200,750],"upper":[650,850]}}},{"Parent":{"children":[{"Leaf":{"from":[1000,150],"to":[1000,250]}},{"Leaf":{"from":[950,450],"to":[950,550]}},{"Leaf":{"from":[1050,450],"to":[1050,550]}},{"Leaf":{"from":[1000,750],"to":[1000,850]}}],"envelope":{"lower":[950,150],"upper":[1050,850]}}},{"Parent":{"children":[{"Leaf":{"from":[1000,1400],
@KOBA789
KOBA789 / check-closed-issues.js
Created April 11, 2022 06:27
https://github.com/notifications で、閉じた Issue や PR を一括で選択するブックマークレット(そのまま Done にすると便利)
javascript:document.querySelectorAll('.notifications-list-item svg.color-fg-done, .notifications-list-item svg.color-fg-danger').forEach((e) => e.parentElement.parentElement.parentElement.previousElementSibling.querySelector('input[type=checkbox]').click());void(0);
@KOBA789
KOBA789 / bunkai-kei.js
Last active November 7, 2021 18:48
http://bunkai-kei.com/ の試聴プレイヤーを dewplayer(Flash 製)から HTML5 Audio に置き換えるブックマークレット
[...document.querySelectorAll('object[data*="/dewplayer.swf"]')].forEach(dew=>{const a=new Audio(new URL(dew.data).searchParams.get('mp3'));a.controls=true;a.style.width='200px';a.style.height='20px';dew.replaceWith(a);})
@KOBA789
KOBA789 / multine-dewplayer.js
Created October 17, 2021 12:19
http://maltinerecords.cs8.biz/ の試聴プレイヤーを dewplayer(Flash 製)から HTML5 Audio に置き換えるブックマークレット
[...document.querySelectorAll('object[data^="/dewplayer.swf"]')].forEach(dew=>{const a=new Audio(new URL(dew.data).searchParams.get('mp3'));a.controls=true;a.style.width='150px';a.style.height='20px';dew.replaceWith(a);})
{"wires":{"root":{"children":[{"Parent":{"children":[{"Parent":{"children":[{"Parent":{"children":[{"Parent":{"children":[{"Leaf":{"from":[550,100],"to":[550,200]}},{"Leaf":{"from":[800,100],"to":[800,200]}},{"Leaf":{"from":[500,400],"to":[500,500]}},{"Leaf":{"from":[750,400],"to":[750,500]}}],"envelope":{"lower":[500,100],"upper":[800,500]}}},{"Parent":{"children":[{"Leaf":{"from":[1000,400],"to":[1000,500]}},{"Leaf":{"from":[1050,100],"to":[1050,200]}},{"Leaf":{"from":[1250,400],"to":[1250,500]}},{"Leaf":{"from":[1300,100],"to":[1300,200]}}],"envelope":{"lower":[1000,100],"upper":[1300,500]}}},{"Parent":{"children":[{"Leaf":{"from":[1500,400],"to":[1500,500]}},{"Leaf":{"from":[1550,100],"to":[1550,200]}},{"Leaf":{"from":[2000,400],"to":[2000,500]}},{"Leaf":{"from":[2050,100],"to":[2050,200]}}],"envelope":{"lower":[1500,100],"upper":[2050,500]}}}],"envelope":{"lower":[500,100],"upper":[2050,500]}}},{"Parent":{"children":[{"Parent":{"children":[{"Leaf":{"from":[550,900],"to":[550,1000]}},{"Leaf":{"from":[800,

Keybase proof

I hereby claim:

  • I am koba789 on github.
  • I am koba789 (https://keybase.io/koba789) on keybase.
  • I have a public key ASBdqnayPVpvFG06bpP6y8zfmcn-hUQrOPZFHh5MqvZ1Ewo

To claim this, I am signing this object: