I hereby claim:
- I am krazylee on github.
- I am kaixiang (https://keybase.io/kaixiang) on keybase.
- I have a public key ASA9wiO-zDAdTkGvMmMAUPIkrSSl2RWlcgLWZ_uvE4E4jwo
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
['rubygems','nokogiri','open-uri','yaml', 'iconv'].each {|lib| require lib} | |
location = ARGV.first or "wuhan" | |
google_url = "http://www.google.com/ig/api?weather=#{URI.encode(location)}" | |
weather = Nokogiri::XML(open(google_url),google_url,"ISO-8859-1") | |
w_info = weather.search('forecast_information').first | |
w_cond = weather.search('current_conditions').first | |
puts "Google: #{google_url}" |
#觉得http://www.geekonomics10000.com/的内容都很不错,写了个脚本分类把文章抓起来做成txt,可以放到手机当电子书看 | |
require "rubygems" | |
require "open-uri" | |
require 'hpricot' | |
blog = File.new("blog.txt","w") | |
%w{self_develop books movies china conventional_wisdom politics science | |
joking us microtrends pop_science social_atom tech critics}.each do |category| | |
puts "downloading category #{category}" | |
blog.puts category |
# encoding: utf-8 | |
require "rubygems" | |
require "mechanize" | |
agent = Mechanize.new | |
page = agent.get("http://fanfou.com/") | |
login_form = page.form | |
login_form.loginname = "username" | |
login_form.loginpass = "password" |
(function($) { | |
$.fn.topic = function(options) { | |
var opts = $.extend({}, $.fn.topic.defaults, options); | |
return this.each(function() { | |
var $this = $(this),rangeLength = opts.text.length + 1; | |
$(opts.btn).click(function(){ | |
$this.focus().val("#"+opts.text+"#"); | |
if($.browser.msie){ | |
var range = $this[0].createTextRange(); | |
var sel = range.duplicate(); |
(function(undefined) { | |
var root = this, | |
previous = root.k, | |
k = function(selector,context){ | |
return new k.fn.init(selector,context); | |
}, | |
//check if html strings | |
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, | |
toString = Object.prototype.toString, |
var a = "I'm a"; |
var HTTPParser = process.binding('http_parser').HTTPParser; | |
exports.HTTPParser = HTTPParser; | |
HTTPParser.prototype.parse = function(data) { | |
var buffer = this.buffer = this.buffer || ""; | |
var start = buffer.length; | |
buffer += data; | |
this.execute(new Buffer(buffer), start, data.length); |
(function(){ | |
$button.click(function(){ | |
return false; | |
}); | |
}) |
I hereby claim:
To claim this, I am signing this object:
wget http://www.trieuvan.com/apache/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz | |
tar xzvf apache-maven-3.5.3-bin.tar.gz | |
mv apache-maven-3.5.3 /usr/local/apache-maven | |
echo "PATH=$PATH:/usr/local/apache-maven/bin" >> ~/.bashrc |