Skip to content

Instantly share code, notes, and snippets.

View kaixiang-li's full-sized avatar
🌴
On vacation

kaixiang kaixiang-li

🌴
On vacation
View GitHub Profile
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

Keybase proof

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:

@kaixiang-li
kaixiang-li / a.js
Created March 24, 2014 14:42
turn anoymous functions to named function
(function(){
$button.click(function(){
return false;
});
})
@kaixiang-li
kaixiang-li / parser.js
Created December 2, 2013 06:51
expose node.js internal http parser.
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);
@kaixiang-li
kaixiang-li / a.js
Created April 4, 2012 08:56
script loader,load all the scripts from the script array
var a = "I'm a";
@kaixiang-li
kaixiang-li / lib.js
Created April 3, 2012 11:20
minimal jQuery
(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,
@kaixiang-li
kaixiang-li / jquery.topic.js
Created March 7, 2012 12:24
微博添加话题组件
(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();
@kaixiang-li
kaixiang-li / mechanize example
Created February 4, 2012 05:24
using mechanize to send a fanfou message
# 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"
@kaixiang-li
kaixiang-li / geekonomics_crawl
Created January 29, 2012 09:41
博客下载脚本
#觉得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
@kaixiang-li
kaixiang-li / weather search
Created January 27, 2012 06:47
查询天气脚本