Skip to content

Instantly share code, notes, and snippets.


Masayoshi Takahashi takahashim

View GitHub Profile
View dropcomment.rb
#!/usr/bin/env ruby
# delete comments for ripper in parse.y
str =[0])
str.gsub!(%r|/\*%.*?%\*/|m, '')
print str
View main.rb
require 'rubycocoa'
##### begin from drb/invokemethod.rb
module DRb
class DRbServer
module InvokeMethod18Mixin
def block_yield(x)
if x.size == 1 && x[0].class == Array
x[0] =[0])
View gist:135436
$ rake test
(in /Users/maki/git/tmp_rack/rack)
/usr/local/ruby191/lib/ruby/1.9.1/pathname.rb:270: warning: `*' interpreted as argument prefix
Skipping Rack::Auth::OpenID tests (ruby-openid 2 is required). `gem install ruby-openid` and try again.
Skipping Rack::Adapter::Camping tests (Camping is required). `gem install camping` and try again.
Skipping Rack::Handler::Mongrel tests (Mongrel is required). `gem install mongrel` and try again.
Skipping Rack::Session::Memcache tests (Memcache is required). `gem install memcache-client` and try again.
Skipping Rack::Handler::Thin tests (Thin is required). `gem install thin` and try again.
Loaded suite [test/spec_rack_auth_basic.rb, test/spec_rack_auth_digest.rb, test/spec_rack_auth_openid.rb, test/spec_rack_builder.rb, test/spec_rack_camping.rb, test/spec_rack_cascade.rb, test/spec_rack_cgi.rb, test/spec_rack_chunked.rb, test/spec_rack_commonlogger.rb, test/spec_rack_conditionalget.rb, test/spec_rack_content_length.rb, test/spec_rack_content_type.rb, test/spec_rack_d
View gist:168876
This file has been truncated, but you can view the full file.
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="description" content="">
<meta name="keywords" content="">
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Twitter Search">
<title>ラノベ - Twitter Search</title>
<link href="/stylesheets/search/twitter.css?1250115178" media="screen" rel="stylesheet" type="text/css">
View content.opf
<?xml version="1.0"?>
<package xmlns="" unique-identifier="BookID" version="2.0">
<metadata xmlns:dc="" xmlns:opf="">
<dc:creator opf:role="aut">sample</dc:creator>
<dc:identifier id="BookID" opf:scheme="URL"></dc:identifier>
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
View opf20.rnc
# OPF2.0 schema in relaxng compact syntax
# generated by RngToRncText.xsl (RngToRnc 1.4)
default namespace opf = ""
namespace dc = ""
start = OPF20.package-element
OPF20.optional-id-attribute = attribute id { xsd:ID }?
View ncx.rnc
# NCX schema in relaxng compact syntax
# original: ncx.rng in epubcheck
# generated by RngToRncText.xsl (RngToRnc 1.4)
default namespace = ""
start =
element ncx
View gist:391826
# epub sample API
epub = EeePub.generate do
title "sample"
creaetor "jugyo", :role => 'aut'
publisher ''
date '2010-05-07', :event=> "publication"
uid '', :scheme => "URL"
item 'foo.html', :label => '1. foo'
View ebook-g.rnc
default namespace=""
start = ebook-g
ebook-g = ebook-g-core
| external "bbebxylog.rnc"
ebook-g-core = meta-g & body-g
meta-g = external "meta-g.rnc"
body-g = element body-g { body }
body =
View gist:432422
Epubcheck Version 1.0.5
ERROR: 20_ipad.epub: length of first filename in archive must be 8, but was 9
ERROR: 20_ipad.epub/OEBPS/Text/cover.xhtml(18): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/pr.xhtml(26): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0002.xhtml(32): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0003.xhtml(32): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0004.xhtml(32): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0006.xhtml(32): required attributes missing
ERROR: 20_ipad.epub/OEBPS/Text/Section0008.xhtml(32): required attributes missing