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/plugin/00default.rb b/plugin/00default.rb | |
index d52ee62..c04a912 100644 | |
--- a/plugin/00default.rb | |
+++ b/plugin/00default.rb | |
@@ -447,7 +447,7 @@ end | |
# make anchor string | |
# | |
def anchor( s ) | |
- if /^([\-\d]+)#?([pct]\d*)?$/ =~ s then | |
+ if /^([\-_\d]+)#?([pct]\d*)?$/ =~ s then |
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
# -*- coding: utf-8 -*- | |
# from: http://weed.cocolog-nifty.com/wzero3es/2010/03/090918-mixigmai.html | |
$KCODE = 'UTF-8' | |
require 'rubygems' | |
require 'mechanize' | |
require 'time' | |
class Mixi |
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
blocked_lines = split_paragraph(lines).map {|i| ["<p>"] + i + ["</p>"] } |
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
############################################# | |
### misc/standalone_cgi/bin/server | |
############################################# | |
kdmsnr:~# ab -n 100 -c 10 http://127.0.0.1:19292/index.rb | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 127.0.0.1 (be patient).....done |
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
# -*- coding: utf-8 -*- | |
numbers = [100, 100000500, 123456789] | |
numbers.each do |number| | |
scales = ["", "万", "億", "兆"] | |
puts number.to_s.gsub(/(\d)(?=(\d\d\d\d)+(?!\d))/, "\\1,").split(',').reverse.inject("") {|result, item| | |
scale = scales.shift | |
item = item.to_i.to_s.gsub(/(\d)(?=(?:\d\d\d)+(?!\d))/, '\1,') | |
result = item + scale + result unless item == "0" | |
result | |
} + '円' |
NewerOlder