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
Index: ext/nkf/nkf-utf8/nkf.c | |
=================================================================== | |
--- ext/nkf/nkf-utf8/nkf.c (revision 20127) | |
+++ ext/nkf/nkf-utf8/nkf.c (working copy) | |
@@ -33,7 +33,7 @@ | |
***********************************************************************/ | |
#define NKF_IDENT "$Id$" | |
#define NKF_VERSION "2.0.8" | |
-#define NKF_RELEASE_DATE "2008-10-28" | |
+#define NKF_RELEASE_DATE "2008-11-07" |
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
/* 強調タグを追加 */ | |
function emphasizeWord(word) { | |
return '<strong>' + word + '</strong>'; | |
} | |
/* 長い順に並べるための比較関数 */ | |
function compareLengthDecrease(a, b) { | |
a = a.length; | |
b = b.length; | |
return a > b ? -1 : a < b ? 1 : 0; |
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
ALLOW_TAGS = %w/font span p b br/ | |
def validate_xml_fragment | |
str = self | |
tags = str.scan(/\G(?:(<[^<>]+>)|[^<>&]+|[^&<>]*(?:&#?\w+;[^&<>]*)+)/) | |
return ERB::Util.html_escape(str) unless $'.empty? | |
stack = [] | |
tags.each do |tag| | |
case tag.first | |
when /<(\w+)(?: +\w+=(?:"[^"]*"|'[^']*'|\w+))* *(\/)?>/ | |
return ERB::Util.html_escape(str) unless ALLOW_TAGS.include?($1) |
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
r = Regexp.compile(<<'__REGEXP__'.strip, Regexp::EXTENDED) | |
(?<json> \g<object> | \g<array> ){0} | |
(?<begin-array> \g<ws> \[ \g<ws> ){0} | |
(?<begin-object> \g<ws> \{ \g<ws> ){0} | |
(?<end-array> \g<ws> \] \g<ws> ){0} | |
(?<end-object> \g<ws> \} \g<ws> ){0} | |
(?<name-separator> \g<ws> : \g<ws> ){0} | |
(?<value-separator> \g<ws> , \g<ws> ){0} | |
(?<ws> [\x20\t\n\r]* ){0} | |
(?<value> false | null | true | \g<object> | \g<array> | \g<number> | \g<string> ){0} |
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
# -*-ruby-*- | |
# | |
# Acknowledgement | |
# @ko1_twitter | |
# http://uno.ac/d/20070727.html | |
# http://iseebi.half-done.net/diary/?date=20070417#p01 | |
# http://mono.kmc.gr.jp/~yhara/d/?date=20070421#p02 | |
# http://www.rubyist.net/~nobu/t/20051013.html#p02 | |
require 'cgi' | |
require 'net/http' |
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
# | |
# Xi Bot | |
# | |
# No rights reserved. | |
# | |
# Synopsis: | |
# xi> 2d10 (two dice of ten) | |
# [2d10] 13 = 7 + 6 | |
# xi> 5d | |
# [5d6] 14 = 3 + 1 + 3 + 1 + 6 |
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
# -*-ruby-*- | |
require 'cgi' | |
require 'net/http' | |
require 'rexml/document' | |
require 'uri' | |
require 'time' | |
class MarldiaBot < Nadoka::NDK_Bot | |
def bot_initialize | |
@chats = @bot_config.fetch(:chats, nil) |
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
Index: lib/libpthread/pthread.c | |
=================================================================== | |
RCS file: /cvsroot/src/lib/libpthread/pthread.c,v | |
retrieving revision 1.106.2.2 | |
diff -u -p -r1.106.2.2 pthread.c | |
--- lib/libpthread/pthread.c 11 Jan 2010 00:47:29 -0000 1.106.2.2 | |
+++ lib/libpthread/pthread.c 8 Feb 2010 22:59:19 -0000 | |
@@ -261,6 +261,8 @@ pthread__child_callback(void) | |
* much. Anything that permits some pthread_* calls to work is | |
* merely being polite. |
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
#! /bin/ruby | |
# http://coderepos.org/share/browser/docs/shyouhei/ruby%20development/merger.rb | |
require 'date' | |
require 'tempfile' | |
$repos = 'svn+ssh://svn@ci.ruby-lang.org/ruby/' | |
ENV['LC_ALL'] = 'C' | |
def help |
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 | |
# If you want an ABNF to Regexp, see below. | |
# http://www.a-k-r.org/abnf/ | |
# https://github.com/martinthomson/abnf2regex | |
require 'strscan' | |
RULENAME_ = /[A-Za-z][A-Za-z0-9\-]*/ | |
C_WSPP_ = /[ \t]+(?:(?:;.*)?\n[ \t]+)*|(?:(?:;.*)?\n[ \t]+)+/ | |
C_WSPS_ = /[ \t]*(?:(?:;.*)?\n[ \t]+)*/ | |
C_NL_ = /(?:;.*)?\n/ |
OlderNewer