Skip to content

Instantly share code, notes, and snippets.

View toshia's full-sized avatar

Toshiaki Asai toshia

View GitHub Profile
@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 / 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
@toshia
toshia / poop_parrot.rb
Created March 8, 2018 13:55
ウーンチ!ウーンチ!ウーンチ!ウーンチ!
Plugin.create(:poop_parrot) do
poop_text = [
'ウンチーーーー!!!',
'ヴーンチ💕ヴーンチ💕ヴーンチ💕ヴーンチ💕',
'ウンチ!?',
'カワイイノ💕'
]
command(:poop_parrot,
name: 'ウーンチ!',
@toshia
toshia / nemui.rb
Created March 6, 2018 00:04
Entityの実験
def get_entity(decorated)
start_index, entity, end_index = Enumerator.new { |y|
Plugin.filtering(:entity_filter, decorated, y)
}.min_by(&:first)
return [decorated] if !start_index
target_text = decorated.description
[
Plugin::Entity::TextEntity.new(
@toshia
toshia / space_dog.txt
Created June 12, 2017 09:12
ズボシホスカencoded string
ズスボシスホボボシスボホシスボシスホボボシシスシシスボシスホボボシススホシスボシスシボボシホボボシスボシスホボボシスシシシスボシスシボボシスボスシスボシススボボシボススシスボシススボボシホシボシシホシススシホシボシスシスボシスホボボシホボシスボシスホボボシススホシスボシスシボボシスボホシスボシスシボボシボホボシスボシスホボボシシスホシカ