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 | |
C = nil | |
o = "" | |
o.instance_eval("def m; C; end") | |
o.m | |
puts 1 | |
o.clone.m | |
puts 2 | |
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
gsed -i "1s/.*/# -\*- coding: utf-8; -\*-\n&/" **/*.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 'fileutils' | |
require 'tempfile' | |
@data_path = "/users/home/hsbt00/homes/diary" | |
@dead_list = "flickr_dead.list" | |
open(@dead_list) do |file| | |
while id = file.gets |
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
Array.forEach( $$(".foo")[0].getElementsByTagName("input"), function(e){ if(e.type=="checkbox") e.checked=true; } ); |
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
require 'rubygems' | |
require 'ruby-prof' | |
RubyProf.start | |
result = RubyProf.stop | |
printer = RubyProf::FlatPrinter.new(result) | |
open('rubyprof.txt', 'w+') do |f| | |
printer.print(f, 0) | |
end |
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 -*- | |
$:.unshift(File.expand_path("../", File.dirname(__FILE__))) | |
require 'webrick' | |
require 'webrick/httpservlet/cgihandler' | |
require 'webrick/httputils' | |
require 'webrick/accesslog' | |
require 'tempfile' | |
require 'fileutils' | |
require 'tdiary' |
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
500 Internal Server Error | |
incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) (Encoding::CompatibilityError) | |
(tdiary/lang/ja.rb):66:in `scan' | |
(tdiary/lang/ja.rb):66:in `shorten' | |
(plugin/makerss.rb):315:in `makerss_desc_shorten' | |
(plugin/makerss.rb):387:in `makerss_body' | |
(plugin/makerss.rb):238:in `block (3 levels) in makerss_update' | |
(plugin/makerss.rb):237:in `each' |
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
500 Internal Server Error | |
incompatible character encodings: UTF-8 and ASCII-8BIT | |
(Encoding::CompatibilityError) | |
(plugin/makerss.rb):384:in `makerss_body' | |
(plugin/makerss.rb):238:in `block (3 levels) in makerss_update' | |
(plugin/makerss.rb):237:in `each' | |
(plugin/makerss.rb):237:in `block (2 levels) in makerss_update' | |
(plugin/makerss.rb):235:in `each' |
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
;; Menloを使う | |
(create-fontset-from-ascii-font "Menlo-14:weight=normal:slant=normal" nil "menlokakugo") | |
(set-fontset-font "fontset-menlokakugo" | |
'unicode | |
(font-spec :family "Hiragino Kaku Gothic ProN" :size 16) | |
nil | |
'append) | |
(add-to-list 'default-frame-alist '(font . "fontset-menlokakugo")) |
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/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': .) % | |
when not(target[0] == ?#) | |
^ | |
from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' | |
from atig.rb:41 |
OlderNewer