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
#!/usr/bin/ruby | |
$LOAD_PATH << File.dirname(__FILE__) | |
MAC_ADDRESS="" | |
def watch(file) | |
open(file) {|f| | |
f.seek(0, IO::SEEK_END) | |
loop { | |
line = f.read |
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
#!/usr/bin/ruby | |
# coding: utf-8 | |
require 'mechanize' | |
require 'openssl' | |
require 'nokogiri' | |
require 'io/console' | |
class MoneyForward | |
def initialize | |
@agent = Mechanize.new{|a| a.ssl_version, a.verify_mode = "SSLv23", OpenSSL::SSL::VERIFY_NONE} |
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
# /usr/bin/ruby | |
class Finder | |
attr_reader :source_file_name | |
def initialize | |
source_file = ARGV[0] | |
unless source_file | |
warn "usage: ruby reference.rb SOURCE_FILE" | |
exit 1 | |
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
#!/usr/bin/ruby | |
require 'tk' | |
require "twitter" | |
require "rubygems" | |
WIDTH = 1200 | |
HEIGHT = 400 | |
FONT_SIZE = 16 | |
c = Tk::Canvas.new(nil, :width=>WIDTH, :height=>HEIGHT, :relief=>:sunken, |
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
#!/usr/bin/ruby | |
#encoding:UTF-8 | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
def get_icon(weather) | |
icon = {"晴"=>"☀", "曇"=>"☁", "雨"=>"☂", "雪"=>"☃"} | |
state = {"時々"=>"~", "のち"=>">"} | |
if 2 < weather.size |
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
#!/usr/bin/ruby | |
require 'tk' | |
c = Tk::Canvas.new(nil, :width=>600, :height=>400, :relief=>:sunken, | |
:borderwidth=>3).pack(:fill=>:both, :expand=>true) | |
f = TkFont.new('Helvetica -16') | |
tag = TkcTag.new(c) |
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
require 'capybara' | |
require 'capybara/dsl' | |
require 'selenium-webdriver' | |
require 'io/console' | |
Capybara.run_server = false | |
Capybara.current_driver = :selenium | |
Capybara.app_host = "https://webauth.ritsumei.ac.jp/fs/customwebauth/login.html?switch_url=https://webauth.ritsumei.ac.jp/login.html&wlan=WebAuth" | |
class Webauth |
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
#!/usr/bin/ruby | |
#encoding:UTF-8 | |
require 'rubygems' | |
require "twitter" | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'daemons' | |
client = Twitter::REST::Client.new do |config| |
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
HEART_FULL="♥" | |
HEART_EMPTY="♡" | |
CHARGING="☇" | |
run_segment() { | |
output=$(__cutinate) | |
if [ -n "$output" ]; then | |
echo "$output" | |
fi | |
} |
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
#! ruby -Ks | |
# coding: utf-8 | |
require 'pp' | |
require 'find' | |
DIRROOT=ARGV[0] | |
Dir.chdir(DIRROOT) | |
Find.find(DIRROOT) do |f| | |
if not File.directory?(f) |