Skip to content

Instantly share code, notes, and snippets.

View toshia's full-sized avatar

Toshiaki Asai toshia

View GitHub Profile
@toshia
toshia / home_timeline.rb
Created May 27, 2012 15:31
かっこいいDSL
Plugin.create :home_timeline do
tab :home_timeline, "Home Timeline" do
set_icon MUI::Skin.get("timeline.png")
timeline :home_timeline end
on_update do |service, messages|
timeline(:home_timeline) << messages end
end
@toshia
toshia / kichigai-has-come.yasnippet
Created July 13, 2012 01:23
あーキチガイきたキチガイ
# -*- mode: snippet -*-
# name: あーキチガイきたキチガイ
# key: kichigai-has-come
# --
あー${1:キチガイ}きた$1
  〃∩ ∧_∧
  ⊂⌒( ・ω・)
   \_つ_つ
         ${2:( ◠‿◠ )}) ))ウッスw
あー$1 いっちゃう$1
@toshia
toshia / uwa.yasnippet
Created August 17, 2012 15:40
うわああああああ
# -*- mode: snippet -*-
# name: うわああああああ
# key: uwa
# --
( ^o^)${1:なんかセリフ}
( ˘⊖˘)。o(待てよ、なんで$1${2:なん}だ…?)
|${3:place}| ┗(☋` )┓三
@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 / durun.rb
Created November 30, 2012 08:09
mikutterプラグインでコードゴルフとかくそわろ
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]}}
@toshia
toshia / lesser_gobou.rb
Created December 25, 2012 03:05
ごぼう♡
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|
@toshia
toshia / gobou.rb
Created December 25, 2012 03:09
ごぼう♡
Plugin.create :gobou do
UserConfig[:gobou_sign] ||= "♡"
UserConfig[:gobou_quantity] ||= 1
command(:gobou,
name: 'ごぼう',
condition: lambda{ |opt| !opt.messages.empty? and opt.messages.all? &amp;:repliable? },
visible: true,
role: :timeline) do |opt|
opt.messages.each do |message|
@toshia
toshia / laco.rb
Created January 27, 2013 11:13
らこらこらこ〜するmikutterプラグイン
Plugin.create :laco do
command(:laco,
name: 'らこらこらこ〜',
condition: lambda{ |opt| true },
visible: true,
role: :timeline) do |opt|
Service.primary.update(message: "らこらこらこ〜")
end
end
@toshia
toshia / spellchecker.rb
Created February 4, 2013 13:34
時事ネタは時間の無駄である
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
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