Skip to content

Instantly share code, notes, and snippets.

Lexin Gong gonglexin

Block or report user

Report or block gonglexin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am gonglexin on github.
  • I am 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 = ''
doc = Nokogiri::HTML(open base_uri)
uris = []
doc.css('.grid a').each do |link|
View open_your_eyes
ssh -qCNgf root@ -D
View application.html.slim
doctype html
title You title here
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
= csrf_meta_tags
= yield
gonglexin / database.rb
Created May 4, 2010
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"
gonglexin / railscasts.rb
Created Apr 28, 2010
Ruby::Download railscasts(markdown format)
View railscasts.rb
require 'rss'
url = ''
rss = RSS::Parser.parse(url)
rss.items.reverse.each do |item|
puts "* [#{item.title}](#{item.enclosure.url})"
gonglexin / chinesedecimal.rb
Created Apr 14, 2010 — forked from xiaods/chinesedecimal.rb
Ruby:convert RMB currency to chinese describe
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( 拾万 佰万 仟万 亿)
You can’t perform that action at this time.