Skip to content

Instantly share code, notes, and snippets.

View unarist's full-sized avatar

unarist unarist

View GitHub Profile
@unarist
unarist / mastodon-lightbox.user.js
Created December 7, 2017 09:56
Mastodon - Lightbox for public pages
// ==UserScript==
// @name Mastodon - Lightbox for public pages
// @namespace https://github.com/unarist/
// @version 0.1
// @author unarist
// @downloadURL https://gist.github.com/unarist/c2ffb91bc7157110653dfd8246c15cd7/raw/mastodon-lightbox.user.js
// @include https://*/@*
// @include https://*/users/*/statuses/*
// @include https://*/users/*/updates/*
// @grant none
@unarist
unarist / mastodon-axios-instance.user.js
Last active November 24, 2017 13:18
Mastodon - 内部実装と同様のaxiosインスタンスを生やす
// ==UserScript==
// @name Mastodon - 内部実装と同様のaxiosインスタンスを生やす
// @namespace https://github.com/unarist/
// @version 0.1
// @author unarist
// @match https://*/web/*
// @downloadURL https://gist.github.com/unarist/9711146754500e801d20c4ca28b870f8/raw/mastodon-axios-instance.user.js
// @require https://unpkg.com/axios/dist/axios.min.js
// @grant none
// ==/UserScript==
SELECT id FROM statuses
WHERE "statuses"."visibility" = 0 
AND (statuses.reblog_of_id IS NULL)
AND (statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id)
AND statuses.account_id IN (
  SELECT target_account_id FROM follows WHERE account_id IN (
    SELECT target_account_id FROM follows WHERE account_id = 100
  )
)
@unarist
unarist / hoge.rake
Created October 27, 2017 15:25
#5538
namespace :fconv do
desc "Reset feeds"
task reset: :environment do
redis = Redis.current
keys = redis.keys('feed:*')
redis.del(keys) if keys.present?
puts "adding"
1000.times do |u|
key = FeedManager.instance.key(:home, u)
redis.pipelined do
@unarist
unarist / gist:8bf029ad7b692a301fb40bc6fe7a055c
Last active October 20, 2017 11:16
StatusIdsToTimestampIds
バージョン文字列 PostgreSQL 9.6.5, compiled by Visual C++ build 1800, 64-bit
VERSION=20170920024819 の db:migrate:down -> db:migrate:up もしくは db:migrate:redo で再現。
$ rake db:migrate:up VERSION=20170920024819
(0.8ms) SELECT pg_try_advisory_lock(5881450594042647960)
(2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
Migrating to StatusIdsToTimestampIds (20170920024819)
(0.4ms) BEGIN
== 20170920024819 StatusIdsToTimestampIds: migrating ==========================
@unarist
unarist / only_statuses.sql
Last active October 23, 2017 11:03 — forked from aschmitz/sample_load.sql
Loading a representative sample of data into a Mastodon database for migration tests
DO $$
DECLARE ratio float;
DECLARE statuses_count integer;
DECLARE conversations_count integer;
DECLARE notifications_count integer;
DECLARE media_attachments_count integer;
DECLARE oauth_access_tokens_count integer;
DECLARE stream_entries_count integer;
DECLARE favourites_count integer;
DECLARE mentions_count integer;
@unarist
unarist / Dockerfile.dev
Created October 13, 2017 05:32
devdondocker
FROM ruby:2.4.1-alpine
LABEL maintainer="https://github.com/tootsuite/mastodon" \
description="A GNU Social-compatible microblogging server"
ENV UID=991 GID=991 \
RAILS_SERVE_STATIC_FILES=true \
RAILS_ENV=production NODE_ENV=production
ARG LIBICONV_VERSION=1.15
@unarist
unarist / mastodon-add-2col-layout.user.js
Last active November 13, 2022 09:12
:don: - Add tablet layout
// ==UserScript==
// @name :don: - Add tablet layout
// @namespace https://github.com/unarist/
// @version 0.8
// @description Add tablet layout (w/ tabbar, w/o compose column) for <=1024 width
// @author unarist
// @match https://mstdn.maud.io/*
// @downloadURL https://gist.github.com/unarist/71067609416aed633cf74eddb6feb725/raw/mastodon-add-2col-layout.user.js
// @grant none
// @run-at document-body
@unarist
unarist / auto_nya-n_s_rec.user.js
Last active March 3, 2018 12:12 — forked from pacochi/auto_nya-n_s_rec.user.js
安全なオートにゃーん(音声認識ロック付き)
// ==UserScript==
// @name auto nya-n (unlock by speech recognition)
// @namespace https://github.com/unarist/
// @include https://*/web/*
// @conrtibutor pacochi https://gist.github.com/pacochi/4295d00d6368c53921047d2a90dca8b5
// @version 1.170908
// @description nya-n
// @downloadURL https://gist.github.com/unarist/d71b04702091fe5a8143af26b78410da/raw/auto_nya-n_s_rec.user.js
// @run-at document-idle
// @grant none
@unarist
unarist / mastodon-remote-follow-links.user.js
Last active April 16, 2018 11:45
:don: - Add web+mastodon://follow link to user page