Skip to content

Instantly share code, notes, and snippets.

@suna-pan
suna-pan / joji_anime.cpp
Last active August 29, 2015 14:17
目の大きさで女児アニメかどうかを判定するやつ
// 女児アニメかどうかを判定するやつ
//
// MITライセンス
//
// C++11
// OpenCV 2.4.9
//
// 使用した顔検出用学習データ
// lbpcascade_animeface
// https://github.com/nagadomi/lbpcascade_animeface
@suna-pan
suna-pan / otaku_construction.rb
Last active August 29, 2015 14:16
mikutterオタク構文警告プラグイン
#-*- coding: utf-8 -*-
require 'gtk2'
module Gtk
class PostBox
class PostToPrimaryService
def post(*args, &proc)
if args[0][:message] =~ /.+(,|,|、).+(感じ|ところ)だ?(。|.|\.)?/
d = Dialog.new
@suna-pan
suna-pan / mikutter_inmu_filter.rb
Created January 8, 2015 12:01
mikutter_inmu_filter
# -*- coding: utf-8 -*-
require 'rexml/document'
require 'open-uri'
Plugin.create(:mikutter_inmu_filter) do
filter_show_filter do |msgs|
msgs = msgs.select do |item|
if item.to_s =~ /(sm\d+)/
video = "http://i.nicovideo.jp/v3/video.array?v=" + $1
doc = REXML::Document.new(open(video))
@suna-pan
suna-pan / euro600_requirements.rb
Last active December 6, 2015 03:01
mikutter_euro600_requirements
#-*- coding: utf-8 -*-
#
# Copyright (c) 2015 suna-pan
# Released under the MIT license
# http://opensource.org/licenses/mit-license.php
#
# 参考:mikutter/core/plugin/display_requirements/display_requirements.rb
#
@suna-pan
suna-pan / mikutter_unko_moll.rb
Last active August 29, 2015 14:00
誰かが💩ウンコモル💩するとつられて💩ウンコモル💩するmikutterプラグイン
#-*- coding: utf-8 -*-
Plugin.create :unko_moll do
on_appear do |ms|
ms.each do |m|
if !m.retweet? && m.user.to_s != Service.primary.user.to_s && m.message.to_s =~ /💩ウンコモル💩/
m.favorite
Service.primary.post :message => "💩ウンコモル💩"
end
end
end
@suna-pan
suna-pan / mikutter_unicode.rb
Last active January 2, 2016 22:19
強いユニコードで攻撃して罪に問われるのを防止するプラグイン
# -*- coding: utf-8 -*-
Plugin.create(:mikutter_unicode) do
filter_gui_postbox_post do |postbox|
text = Plugin.create(:gtk).widgetof(postbox).widget_post.buffer.text
text = text.unpack('U*').collect! do |i|
unless(i == 0xfffd)
[i].pack('U')
else
next
@suna-pan
suna-pan / mikutter_bbswitch.rb
Last active December 26, 2015 09:39
グラボへの給電を切り替える
# -*- coding: utf-8 -*-
Plugin.create(:mikutter_bbswitch) do
filter_gui_postbox_post do |postbox|
buf = ObjectSpace.each_object(Gtk::PostBox).to_a.first.widget_post.buffer
if buf.text =~ /^bbswitch/ then
on if buf.text =~ /on$/
off if buf.text =~ /off$/
state if buf.text =~ /state$/
buf.text = ''
@suna-pan
suna-pan / mikutter_exclude_rt.rb
Last active December 26, 2015 02:59
プラグインにする必要なかった
# -*- coding: utf-8 -*-
Plugin.create(:mikutter_exclude_rt) do
filter_show_filter do |msgs|
msgs = msgs.select{|m| not m.retweet?}
[msgs]
end
end
@suna-pan
suna-pan / autobars.rb
Last active December 20, 2015 13:29
mikutter愛のない全自動バルスプラグインだよ。
# -*- coding: utf-8 -*-
Plugin.create(:mikutter_nolove_bars) do
on_boot do
@buf = Array.new
@id = 0
end
on_appear do |msg|
msg.each do |m|
@suna-pan
suna-pan / ano.rb
Created May 11, 2013 10:26
NULL_CHOLL FUCK
class NullcholFuck
def initialize(prog)
@program = []
until prog.empty?
/^(あっ|えー|あの|えっと|その|…|、|。)(.*)/ =~ prog
raise "文法に誤りがあります." unless $1
@program << $1
prog = $2
end
end