I hereby claim:
- I am gonglexin on github.
- I am gonglexin (https://keybase.io/gonglexin) on keybase.
- I have a public key ASCKe2doI4rkPb-98Y8pLsOf4Qc6lGv6uv4uIy810GLt8Ao
To claim this, I am signing this object:
| {"sig":"7a4d511857260043cf0956936c27b21eeff62b7f7112c57451ed259215ff8c2547dde772e5d77673306c245d3289540eb8769a93ef8bcdc5de03af45edcb2390","msghash":"cefb694aeedac04ecb7cc6bb918482c994d4994b0b2ac73838bc92e1ef774d7a"} |
I hereby claim:
To claim this, I am signing this object:
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'fileutils' | |
| base_uri = 'http://louie.land/wallpapers' | |
| doc = Nokogiri::HTML(open base_uri) | |
| uris = [] | |
| doc.css('.grid a').each do |link| |
| ssh -qCNgf [email protected] -D 127.0.0.1:7070 |
| doctype html | |
| html | |
| head | |
| title You title here | |
| = stylesheet_link_tag "application", :media => "all" | |
| = javascript_include_tag "application" | |
| = csrf_meta_tags | |
| body | |
| = yield |
| require 'rubygems' | |
| require 'activerecord' | |
| # 利用 activerecord 连接数据库 | |
| ActiveRecord::Base.establish_connection(:adapter => "mysql", | |
| :host => 'localhost', | |
| :username => "root", | |
| :password => "root", | |
| #:prot => "3306", | |
| :database => "depot_development" | |
| #:encoding => "utf8" |
| require 'rss' | |
| url = 'http://feeds.feedburner.com/railscasts' | |
| rss = RSS::Parser.parse(url) | |
| rss.items.reverse.each do |item| | |
| puts "* [#{item.title}](#{item.enclosure.url})" | |
| end |
| $KCODE = 'u' | |
| # Goal: 小写金额转换为大写金额 | |
| # Limit: 金额整数位支持到亿位,小数点后支持两位并且不支持四舍五入 | |
| class ChineseFee | |
| attr_reader :chn_numbers, :chn_units, :chn_decimals | |
| def initialize | |
| @chn_numbers = %w(零 壹 贰 叁 肆 伍 陆 柒 捌 玖) | |
| @chn_units = %w(元 拾 佰 仟 万 拾万 佰万 仟万 亿) |