This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WC | |
def unkonow | |
'うんこなう' | |
end | |
end # => :unkonow | |
WC.new.unkonow # => "うんこなう" | |
WC.new.unknown | |
# NoMethodError: undefined method `unknown' for #<WC:0x007fc4420e0f48> | |
# Did you mean? unkonow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require "webkit-gtk2" | |
Plugin.create(:kancolle) do | |
tab(:kancolle, "艦これ") do | |
view = WebKitGtk2::WebView.new | |
view.load_uri("http://www.dmm.com/netgame/feature/kancolle.html") | |
nativewidget view.show_all | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
# -*- coding: utf-8 -*- | |
# how to use | |
# (in minecraft directory) | |
# $ ./basicmod_installer.rb /path/to/minecraft-forge.zip [/path/to/another/mods ...] | |
require "fileutils" | |
MC_ROOT = File.expand_path(File.dirname(__FILE__)) | |
JAR_NAME = "minecraft.jar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DS_Store | |
/screenshots/ | |
/texturepacks-mp-cache/ | |
/lastlogin | |
*.log | |
/saves/MOD Test | |
*(navel * | |
/crash-reports/ | |
/IDChecker/ | |
/stats/stats_toshi_a_unsent.dat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UserConfig[]の戻り値は、freezeされてるから、この戻り値自体に破壊的な変更はできない。 | |
UserConfig[:test] << :value # => なんかエラー | |
freezeされているオブジェクトは、mikutterではmeltで変更可能になるが、その時内部的にはシャローコピーされてしまうので、UserConfig自体には変更できない | |
UserConfig[:test].melt << :value # => [:value] | |
# result | |
UserConfig[:test] # => [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plugin.create :twihai_achievements do | |
defachievement(:red_fav, | |
description: "1つのツイートに5ふぁぼ以上された", | |
hint: "おもしろツイートで5fav以上もらおう" | |
) do |achievement| | |
on_favorite do |service, user, message| | |
if message.user.is_me? and message.favorited_by.size >= 5 | |
achievement.take! end end end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plugin.create :spellchecker do | |
filter_gui_timeline_selected_messages do |timeline, messages| | |
messages.each { |message| | |
raise RuntimeError if /[Ff]ile:\/\/\// =~ message.to_s | |
} | |
[timeline, messages] | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plugin.create :gobou do | |
UserConfig[:gobou_sign] ||= "♡" | |
UserConfig[:gobou_quantity] ||= 1 | |
command(:gobou, | |
name: 'ごぼう', | |
condition: lambda{ |opt| !opt.messages.empty? and opt.messages.all? &:repliable? }, | |
visible: true, | |
role: :timeline) do |opt| | |
opt.messages.each do |message| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plugin.create :gobou do | |
GOBOU_SIGN = "♡" | |
GOBOU_QUANTITY = 1 | |
command(:gobou, | |
name: 'ごぼう', | |
condition: lambda{ |opt| !opt.messages.empty? and opt.messages.all? &:repliable? }, | |
visible: true, | |
role: :timeline) do |opt| | |
opt.messages.each do |message| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d=:durun;Plugin.create(d){e=[];filtershow_filter{|s|s.select{|m|(e&[m.id])[0]}};command(d,name:'封印',condition:->o{o.messages[0]},visible:1,role: :timeline){|o|e << o.messages[0]}} |