YMLib Systems Librarian

一些設定的記錄

我的相片
名稱:
位置: WuGu, Taipei, Taiwan

我是個大光頭,因我的頭型適合這一型。I have a perfect head style.

星期六, 6月 14, 2008

ruby 的 Slide Show (S9) 的一些語法

http://slideshow.rubyforge.org/
http://groups.google.com/group/webslideshow/browse_thread/thread/371fdd28447e51bc

在textile中加上:
title: 特定標題
gradient-colors: green lime
gradient-colors: #0e1f5b #3b5998
gradient: top-bottom black grey
可改變標題、背景,
一些themes在:
http://slideshow.rubyforge.org/themes.html

在slide中要展示一些code,可以用以下參數:
code-theme: blackboard
code-theme: all-hallows-eve
code-line-numbers: false

標籤: , , , , ,

星期四, 6月 12, 2008

216 Web Safe Color Chart by rails

I like the color chart at 216 Web Safe Color Chart, and try to make one for myself by RoR ActionView. the code is followed:

<% a = %w[ F C 9 6 3 0 ] -%>
<% a.each do |k| -%>
<div class=\"<%= cycle(\'left\', \'right\') -%>\">
<table>
<% a.each do |i| -%>
<tr>
<% a.each do |j| -%>
<% code = k + k + i + i + j + j -%>
<% if code =~ /(\\S\\S)(\\S\\S)(\\S\\S)/ -%>
<% r = $1 -%>
<% g = $2 -%>
<% b = $3 -%>
<% rgb = \'R=\' + r.hex.to_s + \'<br />\' + \'G=\' + g.hex.to_s + \'<br />\' + \'B=\' + b.hex.to_s + \'<br />\' -%>
<% end -%>
<td bgcolor=\"#<%= code -%>\">
<% if i =~ /[036]/ -%>
<font color=\"white\">
#<%= k -%><%= k -%><%= i -%><%= i -%><%= j -%><%= j -%><br />
<%= rgb -%>
</font>
<% else -%>
#<%= k -%><%= k -%><%= i -%><%= i -%><%= j -%><%= j -%><br />
<%= rgb -%>
<% end -%>
</td>
<% end -%>
</tr>
<% end -%>
</table>
</div>
<% end -%>

標籤: , , , , ,