Skip to content

Instantly share code, notes, and snippets.

View toshia's full-sized avatar

Toshiaki Asai toshia

View GitHub Profile
@toshia
toshia / retweeted_rewtweet.yml
Created August 27, 2015 23:56
リツイートがリツイートされた時
---
event: retweeted_retweet
created_at: Thu Aug 27 23:43:20 +0000 2015
source:
id: 275974446
id_str: '275974446'
name: "全てが友利奈緒になるいしたん"
screen_name: ishitanhuman
location:
url: https://www.amazon.co.jp/gp/registry/ref=cm_reg_rd-upd?ie=UTF8&id=13HFH6UZUHEDC&type=wishlist
@toshia
toshia / jin115.rb
Created August 28, 2015 10:12
オレ的ゲーム速報がTwitterでSPAM扱いされてるのをなんとかするプラグイン
# -*- coding: utf-8 -*-
Plugin.create(:jin115) do
exclude_url = /jin115\.com/
filter_show_filter do |msgs|
msgs = msgs.reject{ |m| m.entity.any?{ |entity| exclude_url === entity[:url] } }
[msgs]
end
@toshia
toshia / avoid_25939
Last active August 29, 2015 13:56
あっきぃの最近のツイートが見えない不具合の次善策
# あっきぃの最近のツイートが見えない不具合の次善策です。
# 現象: https://dev.twitter.com/discussions/25939
# 祭会場: http://togetter.com/li/629097
Plugin.create(:avoid_25939) do
profiletab :avoid_25939, "avoid 25939" do
set_icon Skin.get("search.png")
uid = user.id
i_timeline = timeline nil do
order do |message|
@toshia
toshia / mikutter_iconbyebye_alt.rb
Created February 20, 2014 15:56
あっきぃが作ってたやつをちょっと変えてみた
# -*- coding: utf-8 -*-
Plugin.create(:mikutter_iconbyebye) do
ALTERNATIVE_IMAGE = "http://pbs.twimg.com/profile_images/434359790551068673/JTrPZYsz_normal.png".freeze
filter_show_filter do |messages|
replaced = messages.map do |message|
if UserConfig[:iconbyebye_sn].include? message.user[:idname]
message[:user] = Message::MessageUser.new(message.user, profile_image_url: ALTERNATIVE_IMAGE)
end
@toshia
toshia / fav_defender.rb
Created May 12, 2014 08:30
DropBox遺跡から出土した謎の古代プラグイン
=begin
絶対に使用してはいけません(後述)。
ファイルのタイムスタンプが 2010/12/31 のふぁぼ爆対策プラグインがでてきたので、記録目的で公開します。
== 仕様
ふぁぼられた相手ごとにふぁぼ数をカウントし、3ふぁぼ以上されると、それ以降ふぁぼられる毎に相手に
いい加減にしろとリプライを送ります。
ふぁぼカウントは、ふぁぼが3分途切れたらリセットされます。
== mikutter 3.0で動かした場合の不具合
@toshia
toshia / 0_reuse_code.js
Created May 16, 2014 11:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Plugin.create(:mikutter_profile_media) do
profiletab :usermediatimeline, _("最近の画像つきツイート") do
set_icon Skin.get("aclog.png")
uid = user.id
i_timeline = timeline nil do
order do |message|
retweet = message.retweeted_statuses.find{ |r| uid == r.user.id }
(retweet || message)[:created].to_i end end
Service.primary.search(q: "from:#{user[:idname]} filter:images",
@toshia
toshia / gist:eb3be3bc824b53e50466
Created September 11, 2014 14:12
戒名判定正規表現を作ろうとして失敗
\A(?<院号>[一-龠]+院)(?<道号>[一-龠]+)(?<戒名>[一-龠]+)(?<位号>居士|信士|信女|童子|童女|水子|禅尼)\Z
@toshia
toshia / rbgtk2-2.2.2test.rb
Last active August 29, 2015 14:08
Ruby2.1.3p242、gtk2 2.2.2では動かないけど2.2.0では動くカウントアップタイマー
# coding: utf-8
#require 'bundler/setup'
require 'gtk2'
window = Gtk::Window.new
w_text = Gtk::Label.new("...")
w_btn = Gtk::Button.new("click")
counter = 0
@toshia
toshia / favorited_retweet.yml
Last active August 29, 2015 14:09
自分がretweetしたstatusに対してfavoriteが発生した時に自分に飛んでくるイベント?こんなの見たこと無いのでしれっと実装されたのだろうか(2回発生)
---
event: favorited_retweet
created_at: Wed Nov 12 00:36:58 +0000 2014
source:
id: 949438177
id_str: '949438177'
name: "ちょまど@11/16ホモ執筆中@文フリ"
screen_name: chomado
location: "(((o(*゚▽゚*)o)))"
profile_location: