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
LocationListener locationListener = new LocationListener() { | |
// Provider的状态在可用、暂时不可用和无服务三个状态直接切换时触发此函数 | |
@Override | |
public void onStatusChanged(String provider, int status, Bundle extras) { | |
} | |
// Provider被enable时触发此函数,比如GPS被打开 | |
@Override | |
public void onProviderEnabled(String provider) { | |
Log.e(this.getClass().toString(), provider); |
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
const double pi = acos(double(-1)); |
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
#!/bin/bash | |
# 使用 openssl 生成密码 | |
openssl rand -base64 12 | |
# 使用 dd 命令生成密码 | |
dd if=/dev/urandom bs=1 count=15 2>/dev/null|base64 -w 0 | |
# 使用 md5sum 生成密码 | |
date |md5sum | |
# 使用 gpg 工具生成密码 | |
gpg --gen-random --armor 1 12 |
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
-- lua添加hearder | |
ngx.header['TEST']= test; |
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
User-agent: * | |
Disallow: / |
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
# Auto detect text files and perform LF normalization | |
* text=auto | |
# Custom for Visual Studio | |
*.cs diff=csharp | |
# Standard to msysgit | |
*.doc diff=astextplain | |
*.DOC diff=astextplain | |
*.docx diff=astextplain |
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
window.addEventListener('error', function (e) { | |
const stack = e.error.stack; | |
let message = e.error.toString(); | |
if (stack) { | |
message += '\n' + stack; | |
} | |
const xhr = new XMLHttpRequest(); | |
xhr.open('POST', '/log', true); | |
xhr.send(message); | |
}); |
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
document.addEventListener('visibilitychange', function () { | |
document.hidden ? document.title = '(●—●)喔哟,崩溃啦!' | |
: document.title = '(/≧▽≦/)咦!又好了!' | |
}) |
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
javascript:document.body.contentEditable='true';document.designMode='on'; void(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
/** | |
* Highlights text within a dom element. | |
* | |
* Specifically this is designed to work with the output | |
* positions of terms returned from a lunr search. | |
* | |
* @param {HTMLElement} element - the element that contains text to highlight. | |
* @param {MatchLocation[]} matches - the list of matches to highlight. | |
*/ | |
module.exports = function (element, matches) { |
OlderNewer