Skip to content

Instantly share code, notes, and snippets.

View toshia's full-sized avatar

Toshiaki Asai toshia

View GitHub Profile
@toshia
toshia / teokute_fav_mikutter.md
Created March 7, 2017 11:21
ておくれ、ふぁぼ、mikutter

ておくれ、ふぁぼ、mikutter

移植するにあたって

2016年10月から、「ておくれ、ふぁぼ、mikutter」を公開していたDropboxが、Publicフォルダに設置したHTMLファイルをWebページとして公開する機能を停止した。これによって、本文書はダウンロードすることは出来るが、ブラウザ上で閲覧することは出来なくなっていた。さらに2017年3月、同15日に明示的に公開リンクを取得しなければPublicフォルダに入れているドキュメントも公開されないように変更するというアナウンスがあった。公開設定をしてもブラウザで閲覧できないことも踏まえると、もうDropboxで公開するのは良い手ではない。

思えばこれを書いたのは2012年末。もう4年以上前ということに驚きを隠せない。本文には書いてないが、丁度祖父が危篤で、年の瀬であることも相まってかなり慌ただしい年末だったと記憶している。結局、2012年12月24日の昼下がり、私が京都の四条河原町近辺でせいべと昼食を食べながら、数日前に公開されたこの文書について語り合っている時に訃報が入り、せいべといっしょにすぐ近くのデパートに喪服を買いに行った。そんなときだったからと言うと言い訳になるが、校正が十分に行き届いておらず、そのうち直そうと思いながら今日に至る。

2012年というのは恐ろしく昔のことだ。2017年現在、StSは消え、Twitterは幾度となく倒産・身売りの話を繰り返し、ふぁぼはいいねになり、おるみんによって新たなておくれクラスタが形成された。今日も人はておくれ、ふぁぼり、mikutterを使っている。この文書は今となっては当時を切り取った貴重な記録になっており、再公開にあたって読み直してみると、自分の記憶が思いの外劣化していることに驚いた。この文書が当時想定していたような役割をちゃんと果たしていることが意外でもあるし嬉しくもある。

@toshia
toshia / eritwin.yasnippet
Created September 18, 2012 13:06
えいつぃんだよー
# -*- mode: snippet -*-
# name: えりつぃんだよー
# key: eritwin
# --
${1:えりつぃんだよ|}
A____A
|・ㅅ・|
|っ c|
${1:$(mapconcat (lambda (c) (concat "| " (char-to-string c) " |")) text "\n")}
|   |
@toshia
toshia / gust.rb
Created September 2, 2020 14:52
ガストソーシャルから、直近のガストタイトルの画像を取得して、マイクラのガストのテクスチャ画像を出力する
# frozen_string_literal: true
require 'nokogiri'
require 'open-uri'
require 'gtk2'
require 'cairo'
Point = Struct.new(:x, :y)
# ガストのどの面に何枚目の広告を貼るか
POSITION = [
@toshia
toshia / rimworld-unpin-compatible-mods.fish
Created August 13, 2020 12:14
RimWorld1.1のままプレイするためにバージョンを固定したMODのなかで、ワークショップで1.1と1.2両対応のバージョンがリリースされたやつだけ固定を解除するスクリプト
#! /bin/fish
# Steam Workshop mods
# ~/.steam/steam/steamapps/workshop/content/294100/
# manual-installed mods
# ~/.steam/steam/steamapps/common/RimWorld/Mods/
for i in ~/.steam/steam/steamapps/workshop/content/294100/*
if [ -f $i/About/About.xml ] && [ -f ~/.steam/steam/steamapps/common/RimWorld/Mods/(basename $i)/About/About.xml ]

Keybase proof

I hereby claim:

  • I am toshia on github.
  • I am toshi_a (https://keybase.io/toshi_a) on keybase.
  • I have a public key ASDpMrmCpRa4LkA8Ma6u7JLysTDfeL5sOjffdegYqNumwwo

To claim this, I am signing this object:

@toshia
toshia / gist:c7f0b4c50919efe1a3f2394ae1b7cd2d
Created August 11, 2019 02:28
何もしてないのにパソコンが壊れた
/home/toshi/.cache/bundle/mikutter-cli/ruby/2.6.0/gems/gobject-introspection-3.3.6/lib/gobject-introspection/loader.rb:268:in `set_field_value': class or module required (TypeError)
from /home/toshi/.cache/bundle/mikutter-cli/ruby/2.6.0/gems/gobject-introspection-3.3.6/lib/gobject-introspection/loader.rb:268:in `block in load_field_writer'
from /home/toshi/Project/mikutter/core/mui/cairo_markup_generator.rb:45:in `block in description_attr_list'
from /home/toshi/Project/mikutter/core/plugin/score/select.rb:48:in `<<'
from /home/toshi/Project/mikutter/core/plugin/score/select.rb:48:in `block (2 levels) in score_expand'
from /home/toshi/Project/mikutter/core/plugin/score/select.rb:44:in `each'
from /home/toshi/Project/mikutter/core/plugin/score/select.rb:44:in `block in score_expand'
from /home/toshi/Project/mikutter/core/mui/cairo_markup_generator.rb:34:in `each'
from /home/toshi/Project/mikutter/core/mui/cairo_markup_generator.rb:34:in `each'
from /home/toshi/Project/mikutter/core/mui/cairo_markup_ge
@toshia
toshia / atelier.md
Created March 10, 2017 14:07
デバイスの名前どこにメモったか忘れた

サーバ

lemon

Debian Testing(メインサーバ)

  • mikutter.hachune.net (mikutter Web)
  • dev.mikutter.hachune.net (Redmine)
  • toshia.dip.jp (Web)
@toshia
toshia / divaschemamodel.rb
Created November 23, 2018 11:05
Diva Schemaを渡してDiva::Modelを定義するやつ
Diva::Model(
fields: [
{ name: "fields",
constraint: { array: { type: "diva://object.type/field" } }
},
{ name: "required",
constraint: { type: "diva://atomic.type/boolean" }
},
{ name: "uri",
constraint: { type: "diva://atomic.type/uri" }
@toshia
toshia / worldon.json
Last active November 4, 2018 16:17
Diva Schema出力テスト
{
"fields": [
{
"name": "id",
"constraint": {
"union": [
{
"type": "diva://atomic.type/null"
},
{
@toshia
toshia / kuso.patch
Created May 1, 2018 22:04
filter stream接続時にstreaming API用のパーサを利用してなかった
diff --git a/core/plugin/streaming/filter.rb b/core/plugin/streaming/filter.rb
index 811d0181..7c28f773 100644
--- a/core/plugin/streaming/filter.rb
+++ b/core/plugin/streaming/filter.rb
@@ -48,7 +48,7 @@ Plugin.create :streaming do
@success_flag = true end
parsed = JSON.parse(json).symbolize
if not parsed[:retweeted_status]
- MikuTwitter::ApiCallSupport::Request::Parser.message(parsed) rescue nil end
+ MikuTwitter::ApiCallSupport::Request::Parser.streaming_message(parsed) rescue nil end