Skip to content

Instantly share code, notes, and snippets.

View hidao80's full-sized avatar

hidao hidao80

View GitHub Profile
@hidao80
hidao80 / How-to サイネージ 企画書
Last active September 22, 2017 09:24
How-to サイネージ企画書
How-to サイネージ企画書
======================
仮称
----
Barrage
特徴
-----
backquote {
display: inline;
}
.twitter-tweet {
display: inline;
}
@hidao80
hidao80 / TimeSpecificationToot.gs
Last active April 14, 2021 23:18
時分指定Tootスクリプト(Google Spreadsheet Script使用)
/**
* 時分指定tootスクリプト
*
* Google Spreadsheetのスクリプトとして設置する、時分指定でtootするためのスクリプト。
* このスクリプトのsetTrigger関数を日ごとに起動するトリガーに指定して利用する。
*
* Spreadsheetの2行目2列目からn行目までに空行を含まずtootしたいメッセージを入力しておくと、
* 上から順にtootし、一番下のメッセージまでTootしたら、一番上のメッセージに戻って
* tootを続ける。
*
@hidao80
hidao80 / hostscan.sh
Created February 9, 2019 22:23
hostscan shell script
#!/bin/sh
usage1="usage: hostscan network-address(24bit-length)"
usage2="ex. hostscan 192.168.0"
usage3=" hostscan 192.168.1.100"
if [ $# -ne 1 ]; then
printf "%s\n%s\n%s\n" "$usage1" "$usage2" "$usage3"
exit 1
fi
@hidao80
hidao80 / MentionReactionToot.gs
Last active June 6, 2020 06:48
【Mastodon】実行時、メンションされていたらDMを返す
/**
* リアクションtootスクリプト
*
* メンションを発見したら直ちにリプライ
*
* アクセストークンとインスタンスのAPI URLはプロジェクトのプロパティに設定しておく。
* ソースコードとトークンおよびインスタンスを切り離すことにより、スクリプトの再利用性が高まった。
*
* リアクションtootスクリプト © @hidao80 クリエイティブ・コモンズ・ライセンス(表示4.0 国際)https://creativecommons.org/licenses/by/4.0/
*/
@hidao80
hidao80 / c9_us2jp_diff.patch
Last active March 2, 2019 10:26
cloud9のメニューを日本語化するパッチ。リポジトリのルートディレクトリで patch -p1 < c9_us2jp_diff.patch`と実行する。
diff --git a/.gitignore b/.gitignore
index 73aa11e..11b3587 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@ build/*/
build/*.zip
build/*.exe
build/*.tgz
+build/*.bak
b9/lib/js/node_modules/
@hidao80
hidao80 / esa_md_upload.sh
Last active August 1, 2020 09:14
esa.io にローカルの Markdown ファイルを連続アップロードするシェルスクリプト
#!/bin/sh
#
# esa.io の 記事投稿 API を使って、ローカルの Markdown ファイルを投稿する
# 投稿に成功したファイルは $sent_file_dir に退避させ、重複登録を防ぐ
# コール制限は 75 回/15分 なので、target_dirに 75ファイル以上入れても 76ファイル目以降で
# 自動で止まる。続きは手動で再実行すること
#
target_dir=default
sent_file_dir=default/sent
api_token=<your-writable-api-token>
@hidao80
hidao80 / mastogetter_url_shortener.gs
Created September 21, 2020 06:27
mastogetter用URL短縮Web API(Google Apps Script版)
//HTTP GETをハンドリングする
function doGet(e) {
//リクエストパラメータ名"q"の値を取得する
//あらかじめURLエンコードしたものを受け取ること!
const text = e.parameter.q;
console.log(text);
console.log(encodeURIComponent(text));
const payload = "url=" + encodeURIComponent(text);
const options = {
"method" : "post",
@hidao80
hidao80 / QiitadonTootToast.js
Last active June 2, 2022 04:43
Qiitadon で投稿があったとき、トーストで通知するブックマークレット
(()=>{
let old_id = document.getElementsByClassName("item-list")[2].firstElementChild.dataset.id;
const timer = setInterval(() => {
let new_id = document.getElementsByClassName("item-list")[2].firstElementChild.dataset.id;
if (old_id !== new_id) {
old_id = new_id;
const parentElm = [...document.querySelectorAll('.column-header')].find(v => /ローカルタイムライン/.test(v.textContent)).parentElement.parentElement;
new Notification(parentElm.querySelector(".display-name__html").textContent, { body: parentElm.querySelector('.status__content')?.textContent ?? '', icon: parentElm.querySelector('.account__avatar, account__avatar-overlay-base')?.style?.backgroundImage?.replace(/^url\("|"\)/g, '') ?? ''});
}
},1000);
/**
* Debugging screen for tablets
*
* Usage:
* import debug from "./debugTablet.js";
* It is also useful to control on/off with the url parameter.
* const DEUBG = new URL(window.location.href).searchParams.get('DEBUG') ? true : false; // Setting the debug flag
* debug.init(DEUBG); // Debugging screen enabled
* debug.alignRight(true); // Right-aligned (left-aligned by default)
*