Skip to content

Instantly share code, notes, and snippets.

@hcmiya
hcmiya / pdp-select.js
Created Sep 4, 2018
小4丼の通知音(2018-09-04)
View pdp-select.js
/* プラウザの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;
@hcmiya
hcmiya / mastodon-no-fav-toka-miru-yatu.user.js
Last active Sep 26, 2018
Mastodonステータスのふぁぼとかを見るやつ
View mastodon-no-fav-toka-miru-yatu.user.js
// ==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 / 001-proxy.md
Last active Mar 15, 2020
Quick example of federating with darknet instances from clearnet
View 001-proxy.md

Quick example of federating with Tor instances from clearnet

figure1

Install and configure Tor / Privoxy

# apt install privoxy tor
@hcmiya
hcmiya / install-tor-instance.md
Last active Aug 16, 2019
Example of building Tor instance
View install-tor-instance.md
  • 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 / mastodon-ni-teikeibun-kino-wo-tukeru-yatu.user.js
Last active Jun 23, 2018
マストドンに定型文機能を付けるやつ
View mastodon-ni-teikeibun-kino-wo-tukeru-yatu.user.js
// ==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 / mastodon-custom-emoji-geta.user.js
Last active Dec 27, 2018
カスタム絵文字をゲタにするやつ
View mastodon-custom-emoji-geta.user.js
// ==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