From: gabriele renzi Date: 2004-12-07T05:32:33+09:00 Subject: Re: [SOT]Signatures and one liners Christian Neukirchen ha scritto: > On Mon, 6 Dec 2004 18:54:29 +0100, Christian Neukirchen > wrote: > >>How about this nice, 134 bytes CGI blog?: >> >>puts"Content-type: text/html\n\n

Blog",Dir["*.entry"].sort_by{|f|-File. >>mtime(f).to_i}.first(9).map{|f|'

'+File.read(f)+'
'} > > > 126 bytes now: > > puts"Content-type: text/html\n\n

Blog",Dir["*.entry"].sort_by{|f|-File. > mtime(f).to_i}[0,9].map{|f|"

#{IO.read f}
"} > I had some fun playing the shortest wiki contest: #!/path/per/ruby -r cgi H='HomePage';B='w7.cgi?n=%s';p=(c=CGI.new('html4')).params;n=p['n'][0]||H d=p['d'][0];t=IO.read(n)rescue '';open(n,'w').puts(t=CGI.escapeHTML(d)) if d c.out{c.h1{n}+c.a(B%H){H}+c.pre{ t.gsub(/([A-Z]\w+){2}/){|w| c.a(B%w){w}}}+c.form("get"){c.textarea('d'){t}+c.hidden('n',n)+c.submit}} the final version with hacks from Mauricio Fernandez was a 3 liner but I can't find it :/