Skip to content

Instantly share code, notes, and snippets.

@hcmiya
hcmiya / mastodon-custom-emoji-geta.user.js
Last active December 27, 2018 08:06
カスタム絵文字をゲタにするやつ
// ==UserScript==
// @name カスタム絵文字をゲタにするやつ
// @namespace https://js4.in/ns/
// @include https://*
// @version 1.0.5
// @grant GM_setValue
// @grant GM_getValue
// @author Miyagi Hikaru
// @website https://gist.github.com/hcmiya/26c4b3d966c6415179cea3176afc06e6
// @updateURL https://gist.github.com/hcmiya/26c4b3d966c6415179cea3176afc06e6/raw/mastodon-custom-emoji-geta.user.js
@hcmiya
hcmiya / mastodon-ni-teikeibun-kino-wo-tukeru-yatu.user.js
Last active June 23, 2018 14:20
マストドンに定型文機能を付けるやつ
// ==UserScript==
// @name マストドンに定型文機能を付けるやつ
// @namespace https://js4.in/ns/
// @include *
// @version 1.0.11
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_deleteValue
// @author Miyagi Hikaru
// @website https://gist.github.com/hcmiya/3645e7ef572685c56e58fca5e1375e0e
@hcmiya
hcmiya / install-tor-instance.md
Last active August 16, 2019 04:05
Example of building Tor instance
  • Install to Debian Buster
  • All of services needed to run Mastodon instance (tor, postgresql, redis, nginx) will be installed to the same server.

Install packages

# apt install postgresql redis nodejs npm ruby tor ffmpeg imagemagick git \
  nginx wget bundler protobuf-compiler iptables-persistent ncurses-term vim \
  gcc g++ make patch ruby-dev libprotobuf-dev libidn11-dev libpq-dev libicu-dev libxml2-dev libxslt1-dev 
@hcmiya
hcmiya / 001-proxy.md
Last active March 15, 2020 19:13
Quick example of federating with darknet instances from clearnet

Quick example of federating with Tor instances from clearnet

figure1

Install and configure Tor / Privoxy

# apt install privoxy tor
@hcmiya
hcmiya / mastodon-no-fav-toka-miru-yatu.user.js
Last active September 26, 2018 22:51
Mastodonステータスのふぁぼとかを見るやつ
// ==UserScript==
// @name Mastodonステータスのふぁぼとかを見るやつ
// @namespace https://js4.in/ns/
// @version 1.0.7
// @description
// @author Miyagi Hikaru
// @include /^https?:\/\/[^\/]+\/(?:@\w+|users\/\w+\/statuses)\/\d+/
// @grant none
// @website https://gist.github.com/hcmiya/453ba90d849d5b4ff0d25ccee94df6c8
// @updateURL https://gist.github.com/hcmiya/453ba90d849d5b4ff0d25ccee94df6c8/raw/mastodon-no-fav-toka-miru-yatu.user.js
@hcmiya
hcmiya / pdp-select.js
Created September 4, 2018 03:36
小4丼の通知音(2018-09-04)
/* プラウザのJSコンソールに貼り付けて実行させると音が鳴る */
(function() {
const n2hz = note => 440 * Math.pow(2, (note - 57) / 12);
const ctx = new AudioContext();
const notes = [65, 72, 77];
const noteStep = 0.078;
for (let delay = 0; delay < 2; delay++) {
const stime = ctx.currentTime + 0.08 + delay * 0.29;