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/env ruby | |
| # -*- coding: utf-8 -*- | |
| require 'rubygems' | |
| require 'hpricot' | |
| require 'open-uri' | |
| require 'nkf' | |
| $KCODE = "u" if VERSION < "1.9.0" | |
| class AmazonItem | |
| attr_accessor :asin |
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
| ## | |
| # Autotest::Screen is test result notify GNU Screen's statusline. | |
| # | |
| # === screenshots | |
| # * <img src="http://f.hatena.ne.jp/images/fotolife/s/secondlife/20061109/20061109015543.png" /> | |
| # * <img src="http://f.hatena.ne.jp/images/fotolife/s/secondlife/20061109/20061109015522.png" /> | |
| # | |
| # == SYNOPSIS | |
| # require 'autotest/screen' | |
| # # Autotest::Screen.statusline = '%H %`%-w%{=b bw}%n %t%{-}%+w (your statusline)' |
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
| # benchmarking yaml_waml converting string. | |
| require 'benchmark' | |
| require 'yaml' | |
| class String | |
| def is_binary_data? | |
| false | |
| 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
| require 'date' | |
| a = Date.new(2008,10,2) | |
| b = Date.new(2008,10,2) | |
| a == b # true | |
| a.eql? # true | |
| a.equal? b # false |
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 'date' | |
| a = Date.new(2008,10,2) | |
| b = Date.new(2008,10,2) | |
| a == b # true | |
| a.eql? # true | |
| a.equal? b # false |
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
| diff --git a/spec/yaml_compatible_spec.rb b/spec/yaml_compatible_spec.rb | |
| index 82d4293..d613253 100644 | |
| --- a/spec/yaml_compatible_spec.rb | |
| +++ b/spec/yaml_compatible_spec.rb | |
| @@ -127,5 +127,9 @@ EOF_TEST_DATA | |
| end | |
| end | |
| rescue LoadError => e | |
| - warn "this spec require rspec-fixture." | |
| + describe "rspec-fixture gem" do |
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
| javascript:var%20asin=document.getElementById('ASIN').value;location.href='http://amazon.jp/o/ASIN/'+asin%20+%20'/kakutani-22'; |
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
| ruby191 -e '([-> v {"Ruby #{v[:n]}!\n"}.(n: "1.9.1")] * 100).each(&:display)' |
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 'fileutils' | |
| require 'action_controller/test_process' | |
| module UploadedDataHelper | |
| def uploaded_data_of(path, mime_type = :auto) | |
| mime_type = detect_mimetype_of(File.basename(path)) if mime_type == :auto | |
| use_temppath(path) do |temppath| | |
| return ActionController::TestUploadedFile.new(temppath, mime_type) | |
| 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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'ruby-debug' | |
| Debugger.start | |
| def pow(x, n) | |
| debugger if n == 1 # start debugger when n == 1 | |
| raise if n < 0 | |
| if n == 0 | |
| return 1 |
OlderNewer