Ctrl-a,将光标移到行首
Ctrl-e,将光标移到末尾
Ctrl-u,删除整行
Ctrl-k,向后删除,从光标开始直至行尾
Alt-Backspace,光标向前删除一个单词
Alt-f,将光标移到后一个单词
Alt-b,将光标移到前一个单词
Ctrl-p,上一条命令
(function(){
function executeCopy(text) {
var input = document.createElement('textarea');
document.body.appendChild(input);
input.value = text;
input.focus();
input.select();
document.execCommand('Copy');
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
``` | |
<?php | |
$content = <<<SSS | |
<p>这是个测试文件</p><p><img src="http://pic2.ooopic.com/12/40/58/18bOOOPIC9c.jpg" /> </p> | |
<p>我们是图片</p> | |
<p><img src="/upload/20180616/1c73423b8269f2414f17217bea141836.jpg"/> </p> | |
<p>这是一个忧伤的故事</p><p><img src="http://img5.duitang.com/uploads/item/201206/15/20120615031447_R5EcS.jpeg" /> </p> | |
<p>谁是天下最帅的男人</p> | |
<p><img src="http://pic3.nipic.com/20090702/918855_174429094_2.jpg"/> </p> |
function registerErrorHandler(callable $callable)
{
set_error_handler(function (int $err_no, string $err_msg, string $err_file = '', int $err_line = 0, array $err_context = []) use ($callable) {
call_user_func($callable, sprintf('%s in file %s at line %s', $err_msg, $err_file, $err_line));
});
set_exception_handler(function (Throwable $e) use ($callable) {
call_user_func($callable, $e->getMessage() . ',FILE:' . $e->getFile() . ',LINE:' . $e->getLine() . ',Trace:' . $e->getTraceAsString());
});
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
var settings = { | |
max_width: 600, | |
max_height: 200 | |
} | |
resize_image = function(img){ | |
var ctx = canvas.getContext("2d") | |
var canvasCopy = document.createElement("canvas") | |
var copyContext = canvasCopy.getContext("2d") |
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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" |
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
-- a quick LUA access script for nginx to check IP addresses against an | |
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
-- | |
-- allows for a common blacklist to be shared between a bunch of nginx | |
-- web servers using a remote redis instance. lookups are cached for a | |
-- configurable period of time. | |
-- | |
-- block an ip: | |
-- redis-cli SADD ip_blacklist 10.1.1.1 | |
-- remove an ip: |
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
-- a quick LUA access script for nginx to check IP addresses against an | |
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
-- | |
-- allows for a common blacklist to be shared between a bunch of nginx | |
-- web servers using a remote redis instance. lookups are cached for a | |
-- configurable period of time. | |
-- | |
-- block an ip: | |
-- redis-cli SADD ip_blacklist 10.1.1.1 | |
-- remove an ip: |
private boolean isMyServiceRunning(Class<?> serviceClass) {
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (serviceClass.getName().equals(service.service.getClassName())) {
return true;
}
}
return false;