View battery_info.rb
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/env ruby | |
# coding: utf-8 | |
require 'highline' | |
def ac_status | |
print "AC: " | |
if open("/sys/class/power_supply/AC/online", 'r').read.to_i == 1 | |
puts "Online" | |
else |
View pdf2outline.sh
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
#!/bin/bash | |
if [ "x$1" = "x" -o "x$2" = "x" ]; then | |
echo Usage: `basename "$0"` "<input.pdf>" "<output.pdf>" >&2 | |
exit 1 | |
fi | |
# change 'ps2write' to 'pswrite' if errors | |
gs -sDEVICE=ps2write -dNOCACHE -sOutputFile=- -q -dbatch \ | |
-dNOPAUSE -dQUIET "$1" -c quit | ps2pdf - "$2" |
View masquerade-curry-ukiuki.rb
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 | |
Plugin.create :masquerade_curry_ukiuki do | |
Thread.new { | |
loop do | |
Plugin.call(:update, nil, [Message.new(:message => "マスカレード・カレー・ウキウキ", :system => true)]) | |
sleep 120 | |
end | |
} | |
end |
View conoha.rb
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/env ruby | |
#-*- coding: utf-8 -*- | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'pp' | |
require 'optparse' | |
PRINT_CREDENTIALS = false |
View toast-alc.rb
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/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
require 'clipboard' | |
require 'cgi' | |
require 'sqlite3' | |
dbname = File.join(ENV['HOME'], '.toast-alc.db') | |
table_name = 'query_result' |
View mikutter_disable_rayban_spam.rb
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 -*- | |
Plugin.create :disable_rayban_spam do | |
filter_show_filter do |messages| | |
messages.reject! do |message| | |
message.to_s =~ /^@|^RT/ and | |
message.to_s.include? "レイバンのサングラス" and | |
message.to_s =~ /\d+円/ | |
end | |
[messages] |
View auto_favorite_sushi514_shio.rb
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 -*- | |
Plugin.create :auto_favorite_sushi514_shio do | |
@target_username = "sushi514" | |
@regexp = /しお|塩|sh?io|salt/ | |
on_appear do |messages| | |
messages.each do |m| | |
next unless m.user.to_s == @target_username |
View ssh
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
#!/bin/bash | |
# | |
# ssh (concatenating split config file) | |
# | |
# Copyright (c) 2014 Takuma Nakajima | |
# | |
# This software is released under the MIT License. | |
# http://opensource.org/licenses/mit-license.php | |
# |
View auto_retweet_previous_tweet.rb
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 -*- | |
Plugin.create :auto_retweet_previous_tweet do | |
tweet_before = {} | |
on_appear do |ms| | |
ms.each do |m| | |
if tweet_before[m.user] | |
tweet_before[m.user].retweet if m.to_s == "いまのなし" |
View mikutter_security_crash.rb
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 -*- | |
Plugin.create :security_crash do | |
# キーワードを設定 | |
UserConfig[:security_crash_keyword] ||= 'abort-mikutter' | |
# TLに流れてきたすべてのツイートを監視 | |
on_appear do |ms| | |
ms.each do |m| | |
# 投稿者が自分で,上記のキーワードと一致しているか確認 |
NewerOlder