- annotation
- bignum (多倍長整数)
- decimal
- rational
- raw inf (64でいい?)
- array inf (64でいい?)
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 | |
if false | |
class C | |
def m | |
xxxx | |
end | |
end | |
def mm | |
yyyy |
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 'nokogiri' | |
# XMLLexer - SAX with scanner like API | |
class XMLLexer | |
def initialize(path) | |
@f = Fiber.new do | |
parser = Nokogiri::HTML::SAX::Parser.new(DocProxy.new) | |
parser.parse_file(path) | |
raise EOFError | |
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
#!/bin/sh | |
# https://gist.github.com/nurse/6101638 | |
export U=naruse | |
export PUBKEY_URL=http://nalsh.jp/ssh.pub | |
## before running this script | |
### Debian | |
# edit /etc/network/interfaces with dns-nameservers | |
# sudo aptitude update && sudo aptitude safe-upgrade |
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
--- gen/thread_stack_pcs.c.orig 2013-02-04 15:51:02.000000000 +0900 | |
+++ gen/thread_stack_pcs.c 2013-02-05 14:45:47.000000000 +0900 | |
@@ -37,6 +37,7 @@ | |
#endif | |
#define INSTACK(a) ((a) >= stackbot && (a) <= stacktop) | |
+#define INALTSTACK(a) ((a) >= altstackbot && (a) <= altstacktop) | |
#if defined(__ppc__) || defined(__ppc64__) || defined(__x86_64__) | |
#define ISALIGNED(a) ((((uintptr_t)(a)) & 0xf) == 0) | |
#elif defined(__arm__) |
野心的な新機能案や、互換性等の理由でおよそ採用されないであろう夢を書き連ねています。
Fixnum と Bignum を削除して、Integer クラスに統合する。両者は Flonum のように内部的に切り替えられる。
Integer#/ の結果を Rational で返すようにする。 https://bugs.ruby-lang.org/issues/5512#change-37021
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
class Rack::File | |
alias _serving serving | |
def serving(env) | |
_serving(env).tap do |status, headers, body| | |
path = env['PATH_INFO'] | |
if path.end_with?('/rss') | |
headers["Content-Type"] = 'application/rss+xml' | |
elsif path.end_with?('.gz') | |
headers["Content-Type"] = Rack::Mime.mime_type(::File.extname(path[0..-4]), 'text/plain') | |
headers["Content-Encoding"] = 'gzip' |