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
View press.one
{"sig":"7a4d511857260043cf0956936c27b21eeff62b7f7112c57451ed259215ff8c2547dde772e5d77673306c245d3289540eb8769a93ef8bcdc5de03af45edcb2390","msghash":"cefb694aeedac04ecb7cc6bb918482c994d4994b0b2ac73838bc92e1ef774d7a"}
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
@gonglexin
gonglexin / database.rb
Created May 4, 2010
Ruby:ActiveRecord连接数据库
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
gonglexin / railscasts.rb
Created Apr 28, 2010
Ruby::Download railscasts(markdown format)
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
@gonglexin
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.