This file contains hidden or 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 hidden or 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
/** | |
* 遗留的问题: 这是utf-8 ?? | |
* 关于encodeURIComponent 与 encodeURI 的最佳实践 | |
* http://stackoverflow.com/questions/75980/best-practice-escape-or-encodeuri-encodeuricomponent | |
* | |
Unicode Strings | |
In most browsers, calling window.btoa on a Unicode string will cause a Character Out Of Range exception. | |
To avoid this, consider this pattern, noted by Johan Sundström |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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