This file contains hidden or 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 -*- | |
Plugin.create :change_name do | |
command(:change_name, | |
name: '名前変更', | |
condition: lambda{|opt|true}, | |
visible: false, | |
role: :window) do |opt| | |
d = Gtk::Dialog.new('名前変更') | |
l = Gtk::Label.new('名前を入れてEnter押してね') | |
e = Gtk::Entry.new |
This file contains hidden or 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 mash(object): | |
def __init__(self, dic={}): | |
dic = {str(k): v if v.__class__ != dict else mash(v) for (k, v) in dic.items()} | |
super(mash, self).__setattr__('_dic', dic) | |
#self.name | |
def __getattr__(self, name): | |
return self._dic[name] | |
#self.name = value |
This file contains hidden or 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
a = ['user == "{0}"'.format(s.strip()) for s in open('user.txt')] | |
b = 'from all where \n' + ('|\n').join(a) | |
open('query.txt','w').write(b) |
This file contains hidden or 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
package net.firsp.amber.util; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.List; | |
public class FuncUtil { | |
public static <A,B> ArrayList<B> map(Collection <A> data, MapFunction<A,B> func){ |
This file contains hidden or 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 -*- | |
Plugin.create :block do | |
command(:block, | |
name: 'ブロックする', | |
condition: Plugin::Command::CanReplyAll, | |
visible: true, | |
icon: nil, | |
role: :timeline) do |opt| |
This file contains hidden or 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 Field | |
def initialize(x,y) | |
@x = x | |
@y = y | |
@m = x.times.map{[false]*y} | |
end | |
def get_size | |
[@x,@y] | |
end |
This file contains hidden or 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 -*- | |
Plugin.create :dig_up do | |
command(:dig_up, | |
name: '掘り返し', | |
condition: Plugin::Command[:HasOneMessage], | |
visible: true, | |
role: :timeline) do |opt| | |
message = opt.messages.first | |
(Service.primary.twitter/'statuses/show').json(:id => message.id, :include_my_retweet => true).next do |m| |
This file contains hidden or 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 Service | |
def streaming(method = :userstream, *args, &proc) | |
twitter.__send__(method, {'include_followings_activity' => true}, &proc) | |
end | |
end |
This file contains hidden or 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 -*- | |
Plugin.create :text do | |
on_mention do |s,ms| | |
ms.each do |m| | |
if Time.now - m.message[:created] < 5 then | |
if m.message.to_s =~ /.*text / then | |
Service.primary.post(:message => m.message.to_s.gsub(/.*text /,'')) | |
end |
This file contains hidden or 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 -*- | |
Plugin.create :mikutter_anime_icon do | |
require 'base64' | |
on_mention do |s,ms| | |
ms.each do |m| | |
if Time.now - m.message[:created] < 5 then | |
if m.message.to_s.split[1] == 'anime_icon' then | |
dir = File.expand_path(File.join(File.dirname(__FILE__), "icon")) | |
subdir = ['.','..'] |