Skip to content

Instantly share code, notes, and snippets.

Avatar

Toshiaki Asai toshia

View GitHub Profile
@toshia
toshia / gust.rb
Created Sep 2, 2020
ガストソーシャルから、直近のガストタイトルの画像を取得して、マイクラのガストのテクスチャ画像を出力する
View gust.rb
# 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 Aug 13, 2020
RimWorld1.1のままプレイするためにバージョンを固定したMODのなかで、ワークショップで1.1と1.2両対応のバージョンがリリースされたやつだけ固定を解除するスクリプト
View rimworld-unpin-compatible-mods.fish
#! /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 ]
View keybase.md

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 Aug 11, 2019
何もしてないのにパソコンが壊れた
View gist:c7f0b4c50919efe1a3f2394ae1b7cd2d
/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 Nov 23, 2018
Diva Schemaを渡してDiva::Modelを定義するやつ
View divaschemamodel.rb
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 Nov 4, 2018
Diva Schema出力テスト
View worldon.json
{
"fields": [
{
"name": "id",
"constraint": {
"union": [
{
"type": "diva://atomic.type/null"
},
{
@toshia
toshia / kuso.patch
Created May 1, 2018
filter stream接続時にstreaming API用のパーサを利用してなかった
View kuso.patch
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 Mar 8, 2018
ウーンチ!ウーンチ!ウーンチ!ウーンチ!
View poop_parrot.rb
Plugin.create(:poop_parrot) do
poop_text = [
'ウンチーーーー!!!',
'ヴーンチ💕ヴーンチ💕ヴーンチ💕ヴーンチ💕',
'ウンチ!?',
'カワイイノ💕'
]
command(:poop_parrot,
name: 'ウーンチ!',
@toshia
toshia / nemui.rb
Created Mar 6, 2018
Entityの実験
View nemui.rb
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 Jun 12, 2017
ズボシホスカencoded string
View space_dog.txt
ズスボシスホボボシスボホシスボシスホボボシシスシシスボシスホボボシススホシスボシスシボボシホボボシスボシスホボボシスシシシスボシスシボボシスボスシスボシススボボシボススシスボシススボボシホシボシシホシススシホシボシスシスボシスホボボシホボシスボシスホボボシススホシスボシスシボボシスボホシスボシスシボボシボホボシスボシスホボボシシスホシカ