Skip to content

Instantly share code, notes, and snippets.

View MitarashiDango's full-sized avatar

MitarashiDango MitarashiDango

View GitHub Profile
@MitarashiDango
MitarashiDango / bookmarklet_tissue_intent.js
Created February 12, 2019 18:06
見ているおかずをTissueへチェックインするやつ(初期実装版)
javascript:window.open("https://shikorism.net/checkin?link="+encodeURIComponent(location.href),"_blank","scrollbars=yes,resizable=yes,width=500,height=360");
@MitarashiDango
MitarashiDango / bookmarklet_mastodon_share_intent.js
Created December 24, 2018 06:30
見てるWebページのタイトルとURLをMastodonでシェアするやつ
javascript:window.open("https://mastodon.matcha-soft.com/share?text="+encodeURIComponent(document.title+" "+location.href),"_blank","scrollbars=yes,resizable=yes,width=500,height=360");
@MitarashiDango
MitarashiDango / mastodon_domain_list.sh
Created September 23, 2018 19:44
認識済みインスタンスのドメイン一覧を出力するやつ
psql -t -c "SELECT domain FROM accounts WHERE domain <> '' GROUP BY domain ORDER BY domain ASC" "mastodon" | awk '{ sub(/^[ \t]+/, "") }1'
@MitarashiDango
MitarashiDango / elasticsearch_plugins_update.sh
Last active November 8, 2018 14:57
Elasticsearchのプラグインを一括更新するやつ
#!/bin/bash
ELASTICSEARCH_DIR=/usr/share/elasticsearch
cd $ELASTICSEARCH_DIR
systemctl stop elasticsearch
PLUGIN_LIST="$(bin/elasticsearch-plugin list -s)"
@MitarashiDango
MitarashiDango / remove_remote_without_favourite.txt
Last active February 4, 2018 18:12
お気に入りされてない7日以上前のリモートメディアキャッシュを削除するやつ
time_ago = ENV.fetch('NUM_DAYS') { 7 }.to_i.days.ago
MediaAttachment.where.not(remote_url: '').where.not(file_file_name: nil).where('created_at < ?', time_ago).find_each do |media|
if Account.where(id: Favourite.select('account_id').where(status_id: media.status_id)).where(domain: nil).count == 0
media.file.destroy
media.save
end
end

Keybase proof

I hereby claim:

  • I am mitarashidango on github.
  • I am mitarashi_dango (https://keybase.io/mitarashi_dango) on keybase.
  • I have a public key ASBFdPB7ztJefAiZJ0F4w7qGum3zzvjh4lveG0sg7sFF1go

To claim this, I am signing this object:

@MitarashiDango
MitarashiDango / MastodonAccounts.md
Last active August 14, 2017 18:36
各インスタンスに作られたアカウント一覧

Mastodon アカウント一覧

アカウントID インスタンス アカウント種別 備考
mitarashi_dango mastodon.matcha-soft.com メインアカウント お一人様インスタンス
mitarashi_dango friends.nico サブアカウント LTLメイン運用
mitarashi_dango pawoo.net サブアカウント
mitarashi_dango music.pawoo.net サブアカウント
mitarashi_dango mstdn.jp サブアカウント
mitarashi_dango mastodon.cloud サブアカウント