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/local/bin/ruby -Ks | |
# 大分昔に作ったので恥ずかしいソースだわ | |
class Image | |
attr_accessor :width, :height, :bit, :plt, :trans_flg, :transparent_idx | |
# 2次元配列を指定する | |
def initialize(wid=nil, hei=nil, img=nil, plt=nil) | |
if img | |
make(wid||1, hei||1, img.flatten) | |
else |
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/lib/ruby/gems/1.8/gems/rvm-0.0.82/scripts/ruby-installer 2009-11-25 19:07:14.000000000 +0900 | |
+++ ~/.rvm/scripts/ruby-installer 2009-11-26 10:49:02.000000000 +0900 | |
@@ -410,7 +410,7 @@ | |
PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -) | |
PATH=$rvm_bin_path:$PATH ; export PATH | |
- rvm_ruby_repo_url=$rvm_shyouhei_repo_url | |
+ #rvm_ruby_repo_url=$rvm_shyouhei_repo_url | |
unset rvm_ruby_configure | |
rvm_ruby_src_path=$rvm_ruby_home |
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/ruby -wKU | |
# -*- coding: utf-8 -*- | |
require 'nkf' | |
puts RUBY_DESCRIPTION | |
a = 'ア' | |
puts NKF.nkf('-m0 -w -W',a).dump == a.dump | |
puts NKF.nkf('-m0 -w -W',a).dump == [0xFF71].pack('U').dump | |
az = 'ア' |
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/ruby -wKU | |
require 'open-uri' | |
require 'uri' | |
require 'fileutils' | |
require 'rubygems' | |
require 'nokogiri' | |
class SArray | |
def initialize str | |
@source = str.dup |
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
module Termtter::Client | |
register_command( | |
:name => :list_from_storage, | |
:aliases => [:lfs], | |
:exec_proc => lambda {|arg| | |
limit = arg.strip.to_i | |
limit = 50 if limit == 0 | |
statuses = Termtter::Storage::Status.list(limit) | |
output(statuses, :search) | |
}, |
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
# Chromium Reindexer | |
require 'find' | |
thrds = [] | |
Find.find(File.expand_path("~/.config/chromium/Default")) do |fn| | |
next unless FileTest.file? fn | |
next unless File.read(fn, 15) == "SQLite format 3" | |
thrds << Thread.start(fn) do |target| | |
before = File.size target | |
if system "sqlite3 '#{target}' 'vacuum;reindex'" | |
puts "#{target}\n#{before}byte(s) => #{File.size target}byte(s)" |
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 'rubygems' | |
require 'term/ansicolor' | |
if ARGV.size == 0 | |
STDERR.puts "Usage: #{$0} program ..." | |
exit 1 | |
end | |
include Term::ANSIColor |
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
$ spec spec/*_spec.rb -f s | |
E4U::Encode::DoCoMo encode | |
- from[:carrier]が:docomo以外ならば例外が起こる | |
E4U::Encode::DoCoMo encode to[:carrier]が:docomo以外の時 | |
- from[:encoding]が:utf8なら :unicodeに変換される | |
- from[:encoding]が:sjisなら :unicodeに変換される | |
- from[:encoding]が:unicodeなら from[:carrier]が:googleに変換される |
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
--- ZenTest-4.2.1/lib/autotest.rb.orig 2010-01-12 16:54:06.000000000 +0900 | |
+++ ZenTest-4.2.1/lib/autotest.rb 2010-01-12 16:55:30.446650022 +0900 | |
@@ -243,7 +243,7 @@ | |
open("| #{cmd}", "r") do |f| | |
until f.eof? do | |
c = f.getc or break | |
- putc c | |
+ print c | |
line << c | |
if c == ?\n then |
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
# 入力をすべてUTF8のGoogle絵文字に変換する | |
E4U.encode(string, :docomo => :google, :sjis => :utf8) # DoCoMoのSJIS絵文字を変換 | |
E4U.encode(string, :kddi => :google, :sjis => :utf8) # KDDIのSJIS絵文字を変換 | |
E4U.encode(string, :softbank => :google, :utf8 => :utf8) # SBのUTF-8絵文字を変換 | |
# アプリ内部ではGoogle絵文字を相手にする | |
# : | |
# 出力時にそれぞれのキャリア用に変換する | |
E4U.encode(string, :google => :docomo, :utf8 => :sjis) # DoCoMoはSJIS絵文字を出力 |