Skip to content

Instantly share code, notes, and snippets.

View unarist's full-sized avatar

unarist unarist

View GitHub Profile
@unarist
unarist / mastodon-replace-web-client.user.js
Last active April 19, 2018 04:17
Mastodon - Replace web client with specified assets
// ==UserScript==
// @name Mastodon - Replace web client
// @namespace https://github.com/unarist/
// @version 0.2
// @description Replace web client with local assets
// @author unarist
// @match https://mstdn.maud.io/
// @match https://mstdn.maud.io/favicon.ico
// @match https://mstdn.maud.io/web/*
// @grant none
window.fetch = window.fetch || function (url, options) {
return new Promise(function (resolve) {
const xhr = new XMLHttpRequest();
xhr.onloadend = function() {
resolve(Object.assign({}, xhr, {
ok: xhr.status === 200,
status: xhr.status,
statusText: xhr.statusText
}));
@unarist
unarist / mastodon-mobile-composer.user.js
Last active January 24, 2025 17:26
Mastodon - Mobile Composer
// ==UserScript==
// @name Mastodon - Mobile Composer
// @namespace https://github.com/unarist/
// @version 0.15
// @description add composer to page bottom
// @author unarist
// @downloadURL https://gist.github.com/unarist/08f56c49986d3b1775fe88bc918cac50/raw/mastodon-mobile-composer.user.js
// @match https://*/web/*
// @match https://*/deck/*
// @match https://mstdn.maud.io/*
Doorkeeper::Application.create!(name: 'Web', superapp: true, redirect_uri: Doorkeeper.configuration.native_redirect_uri, scopes: 'read write follow')
if Rails.env.development?
domain = ENV['LOCAL_DOMAIN'] || Rails.configuration.x.local_domain
admin = Account.where(username: 'admin').first_or_initialize(username: 'admin')
admin.save(validate: false)
User.where(email: "admin@#{domain}").first_or_initialize(email: "admin@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, admin: true, account: admin).save!
accounts = 20.times.map { |i| Account.where(username: "test#{i}").first_or_create!(username: "test#{i}") }
accounts.each do |account|
@unarist
unarist / let-codemirror.user.js
Last active June 18, 2023 08:12
Hatena::Let - CodeMirror
// ==UserScript==
// @name Hatena::Let - CodeMirror
// @namespace https://github.com/unarist/
// @version 0.2.1
// @description Replace plain textarea with CodeMirror!
// @author unarist
// @downloadURL https://gist.github.com/unarist/1fb6ce33daa34ecdbd5f2060d32c65a3/raw/let-codemirror.user.js
// @match https://let.hatelabo.jp/l
// @grant none
// ==/UserScript==
@unarist
unarist / mastodon-mods.md
Created July 17, 2017 12:50
Mastodon向けmod各種

[]内は実装時のバージョン。それ以前・以降でも動くかもしれない。

{
"screen_name": "test",
"bio": "mogmog",
"following": [
"https://gist.github.com/unarist/6d074e7d8e460f6974a440c2e4403956/raw/user.json",
"https://raw.githubusercontent.com/hvdsgm/social-graph-layer-examples/master/vaginaplant.json",
"https://raw.githubusercontent.com/hvdsgm/social-graph-layer-examples/master/kasai-kumin.json"
],
"text_service_user_url": "http://zipgun.distsn.org/cgi-bin/zipgun-get-user-events.cgi?F0EE148F898A4A8D90DF85D7BA1CB8CC2D131542493C54C8CCB43FF05BBC2691",
"text_service_user_url_timestamp": "0"
# frozen_string_literal: true
namespace :dev do
desc "Seed some accounts"
task seed: :environment do
domain = ENV['LOCAL_DOMAIN'] || Rails.configuration.x.local_domain
admin = Account.find_local('admin')
accounts = 20.times.map { |i| Account.find_or_create_by(username: "test#{i}") }
accounts.each do |account|
User.where(email: "#{account.username}@#{domain}").first_or_create_by(email: "#{account.username}@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, admin: false, account: account)
@unarist
unarist / SKK-JISYO.emoji.utf8
Last active August 12, 2025 16:22
SKK gemoji dic w/ generate script
;; -*- fundamental -*- ; coding: utf-8 -*-
;; Emoji dictionary for SKK system
;;
;; Generated from gemoji @3f60571 like below:
;;
;; emojis = JSON.parse(/* read from db/emoji.json */)
;; [].concat(...emojis.filter(({emoji}) => emoji).map(({emoji,aliases}) => aliases.map(alias => `:${alias}: /${emoji}/`))).sort().join('\n')
;;
;; inspired by https://github.com/uasi/skk-emoji-jisyo
;;
@unarist
unarist / mastodon-remote-follow-links.user.js
Last active April 16, 2018 11:45
:don: - Add web+mastodon://follow link to user page