Skip to content

Instantly share code, notes, and snippets.

View hidao80's full-sized avatar

hidao hidao80

View GitHub Profile
@hidao80
hidao80 / ChatWorkMessageSpeech.js
Last active September 3, 2023 03:03
ChatWorkの投稿自動読み上げbookmarklet
/**
* Copyright (c) 2022 hidao80
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
// bookmarklet:
// javascript:(()=>{let msg=e=>{let msg=document.querySelectorAll("._message");return msg[msg.length-1]},lastMsg=e=>msg().getElementsByTagName("pre")[0].textContent,lastMsgId=e=>msg().dataset.mid,speakerName=e=>{let name=document.querySelectorAll("._speakerName");return name[name.length-1].textContent},old_id=lastMsgId();const synth=new SpeechSynthesisUtterance;speechSynthesis.onvoiceschanged=()=>{const voices=speechSynthesis.getVoices();if(navigator.userAgent.toLowerCase().indexOf("edg")>-1)for(let i=0;i<voices.length;i++)voices[i].name.indexOf("Nanami")>-1&&(synth.voice=voices[i])},setInterval(()=>{let new_id=lastMsgId();old_id!=new_id&&(old_id=new_id,speechSynthesis.cancel(),synth.text=speakerName()+"さんの投稿。"+lastMsg().replace(/https?:\/\/[\w/:%#\$&\?\(\)~\.=\+\-]+/g," "),speechSynthesis.speak(synth))},1e3)})();
(() => {
let msg = e => {
/**
* Copyright (c) 2022 hidao80
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
(function () {
const instance = "https://misskey.dev";
const link_text = "選択範囲へ直リンク";
const LF = '\n';
const CR = '\r';
@hidao80
hidao80 / url-sticky.js
Last active December 9, 2024 17:47
A bookmarklet that saves and edits the memo associated with the url in the browser.
/**
* Copyright (c) 2022 hidao80
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
/*
README
========
url-sticky
@hidao80
hidao80 / commit-msg
Last active September 3, 2023 02:56
git hooks for laravel and Redmine
#!/bin/bash
<< COMMENT
Copyright (c) 2022 hidao80
Released under the MIT license
https://opensource.org/licenses/mit-license.php
COMMENT
#
# Message pre-process
#
msg=`cat $1 | sed -e '/^#/d'`
@hidao80
hidao80 / Right-click-jammer-canceller.bookmarklet.js
Last active September 5, 2023 09:46
Bookmarklet to enable context menus on web pages that do not allow right-clicking.
javascript:(()%3D%3E%7B!function()%7Bfor(const%20o%20of%5Bdocument%2Cdocument.body%5D)o.addEventListener(%22contextmenu%22%2C(o%3D%3E%7Bo.stopImmediatePropagation()%7D)%2C!0)%7D()%3B%7D)()
@hidao80
hidao80 / Misskey-v11_RssReaderLikeDeck.css
Created December 5, 2022 14:49
This css changes the deck layout of Misskey v11 to an RSS reader-like layout.
article div.main {
display: flex;
}
article div.body {
margin-left: 0.5rem;
margin-right: auto;
}
article div.text p, article div.text span, article div.text br {
content: attr(text);
}
@hidao80
hidao80 / FediversTextBlur.stylus.css
Last active January 9, 2023 04:38
Mastodon/Misskey text blur style
/* ==UserStyle==
@name FediversTextBlur
@namespace github.com/hidao80/stylus
@version 1.1.3
@description Mastodon/Misskey text blur style
@author hidao80
@homepageURL https://gist.github.com/hidao80/f3766691d16c4a8e8644b37d01754ce0
@updateURL https://gist.githubusercontent.com/hidao80/f3766691d16c4a8e8644b37d01754ce0/raw/e088585c03694db3964dcf9ce0b1c658f512ab85/FediversTextBlur.stylus.css
@license MIT
==/UserStyle== */
@hidao80
hidao80 / MisskeyV11InvisibleProfile.bookmarklet.js
Last active February 23, 2023 08:33
消えないプロフィール列 for Misskey.dev
(()=>{const username=JSON.parse(localStorage.getItem("vuex")).i.username,a=document.querySelector(`a[title=${username}]`);a.click(),setTimeout(()=>{const main=document.querySelector("#app > div.content > div"),profile=document.querySelector("div[data-v-2e1e50f0].dnpfarvgbnfmyzbdquhhzyxcmstpdqzs");let div=profile.cloneNode(!0);div.querySelector("button.close").onclick=e=>e.target.parentNode.parentNode.remove(),main.insertBefore(div,document.querySelector("#app > div.content > div > button")),setTimeout(()=>{profile.querySelector("button.close").click()},500)},500)})();
@hidao80
hidao80 / FediverseTextBlur.bookmarklet.js
Last active March 9, 2023 22:13
Blur text in Misskey v11 and Mastodon.
javascript:(()%3D%3E%7Bconst%20KEY%3D%22FediverseTextBlur_bookmarklet_cssRules_indexes%22%2Cstyles%3D%5B%22article%20.havbbuyv%2C%5Cnarticle%20.status__content%2C%5Cnarticle%20.display-name%20%7B%5Cnfilter%3A%20blur(5px)%3B%5Cn%7D%22%5D%3Blet%20indexes%3DJSON.parse(localStorage.getItem(KEY)%7C%7C%22%5B%5D%22)%3Bconst%20usableSheet%3D%5B...document.styleSheets%5D.slice(-1)%5B0%5D%3Bif(indexes.length%3E0)%7Bfor(const%20e%20of%20indexes)usableSheet.deleteRule(e)%3BlocalStorage.setItem(KEY%2C%22%5B%5D%22)%7Delse%7Bconst%20e%3DusableSheet.cssRules.length%3Bfor(let%20s%20of%20styles)indexes.push(e)%2CusableSheet.insertRule(s%2Ce)%3BlocalStorage.setItem(KEY%2CJSON.stringify(indexes))%7D%7D)()
@hidao80
hidao80 / simple-preview-modal.js
Last active September 2, 2024 12:17
Script that will open an image preview dialog by loading and specifying a class for the target tag.
/**
* Usage: Add the class name "hd simple-preview-modal" to the image tag.
* If you want to load a different image from the src attribute, add the data-preview-src attribute.
* <img src="..." class="hd simple-preview-modal" data-preview-src="...">
*
* Copyright (c) 2023 hidao80
* Released under the MIT license
* https://opensource.org/licenses/mit-license.php
*/
(() => {