This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Getting window size and scroll bars position in JavaScript/DHTML | |
* http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html | |
*/ | |
function f_clientWidth() { | |
return f_filterResults ( | |
window.innerWidth ? window.innerWidth : 0, | |
document.documentElement ? document.documentElement.clientWidth : 0, | |
document.body ? document.body.clientWidth : 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 关于事件监听最佳实践 | |
* http://www.cnblogs.com/snowball/archive/2006/08/16/478531.html | |
*/ | |
function associateObjWithEvent(obj, methodName){ | |
return (function(e){ | |
e = e||window.event; | |
// obj == DthmlObject , it's OK , but obj == new DthmlObject(),it's not |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* http://javascript0.org/wiki/Portable_sendAsBinary | |
* portable sendAsBinary | |
*/ | |
XMLHttpRequest.prototype.sendAsBinary = function(datastr) { | |
function byteValue(x) { | |
return x.charCodeAt(0) & 0xff; | |
} | |
var ords = Array.prototype.map.call(datastr, byteValue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(q){ | |
!!q?q.toggle(): | |
(function(d,j){ | |
j=d.createElement('script'); | |
j.src='//ime.qq.com/fcgi-bin/getjs'; | |
j.setAttribute('ime-cfg','lt=2'); | |
d.getElementsByTagName('head')[0].appendChild(j) | |
} | |
) | |
(document)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://tool.chinaz.com/ 站长工具 | |
http://www.linkwan.com/gb/ 网络测试(基于google地图) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spawn openvpn --config /etc/openvpn/Global.ovpn | |
#expect "[sudo] password for hyvi: " | |
#send "密码\n" | |
#sleep 2 | |
expect "Enter Auth Username:" | |
send "邮箱\r" | |
sleep 2 | |
expect "Enter Auth Password:" | |
send "密码\r" | |
expect eof |
NewerOlder