Skip to content

Instantly share code, notes, and snippets.

View JagoWang's full-sized avatar
🌾

Jago JagoWang

🌾
View GitHub Profile
@JagoWang
JagoWang / JS获取请求参数
Created July 10, 2015 01:56
JS获取请求参数数组及指定参数
//获取请求参数数组
function getUrlVars(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
@JagoWang
JagoWang / Markdown syntax test
Last active August 29, 2015 13:57
Markdown syntax test
*强调*
<script type="text/javascript">
Array.prototype.ayromove = function(dx) {
if(isNaN(dx)||dx>this.length){return false;}
this.splice(dx,1);
}
var arr = ['a', 'b', 'c'];
console.log("elements: "+ arr + " nLength: " + arr.length);
arr.ayromove(1); //删除下标为1的元素
console.log("elements: "+ arr + " nLength: " + arr.length);
</script>
@JagoWang
JagoWang / keepalived + nginx
Created March 7, 2013 10:30
keepalived + nginx
keepalived + nginx
容灾+负载
/**
* 分析豆瓣阅读查看电子书的逻辑
*
* 主要用到的JavaScript为
* 1. OzJS(管理模块)
* 2. jQuery(base库)
* 3. Backbone.js(web application框架)
*
* 过程分析
* --------
命令方式启动tomcat没有滚屏日志信息,可以到logs目录下看。
tomcat远程调试:
1. 修改startup.bat 在尾部修改成以下列方式启动
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
call "%EXECUTABLE%" jpda start
2. catalina.sh jpda start
@JagoWang
JagoWang / Linux note
Last active December 14, 2015 04:48
Linux note
chmod和数字改变文件或目录的访问权限
chown改变目录或文件的所有权
chown root $dir
-R 递归子目录
http://soft.yesky.com/115/11046615.shtml
echo "" >>/> file
@JagoWang
JagoWang / 1024以下端口必须由root账户启动
Created February 25, 2013 14:43
1024以下端口必须由root账户启动
1024以下端口必须由root账户启动
@JagoWang
JagoWang / Apache httpd
Last active December 13, 2015 22:09
Apache httpd
Apache:
httpd -t //检查配置是否正确
service httpd reload //重新加载配置
启动,重启和停止
/usr/local/apache/bin/apachectl -k start (不加参数k也行)
/usr/local/apache/bin/apachectl -k restart
/usr/local/apache/bin/apachectl -k stop
ln -s 源目录 目标目录