View keybase.md

Keybase proof

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:

View wallpapers.rb
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|
View open_your_eyes
ssh -qCNgf root@8.8.8.8 -D 127.0.0.1:7070
View application.html.slim
doctype html
html
head
title You title here
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
= csrf_meta_tags
body
= yield
View database.rb
require 'rubygems'
require 'activerecord'
# 利用 activerecord 连接数据库
ActiveRecord::Base.establish_connection(:adapter => "mysql",
:host => 'localhost',
:username => "root",
:password => "root",
#:prot => "3306",
:database => "depot_development"
#:encoding => "utf8"
View railscasts.rb
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
View chinesedecimal.rb
$KCODE = 'u'
# Goal: 小写金额转换为大写金额
# Limit: 金额整数位支持到亿位,小数点后支持两位并且不支持四舍五入
class ChineseFee
attr_reader :chn_numbers, :chn_units, :chn_decimals
def initialize
@chn_numbers = %w(零 壹 贰 叁 肆 伍 陆 柒 捌 玖)
@chn_units = %w(元 拾 佰 仟 万 拾万 佰万 仟万 亿)