Skip to content

Instantly share code, notes, and snippets.

View an9er's full-sized avatar

gcj an9er

View GitHub Profile
@an9er
an9er / netstat-1
Last active December 8, 2016 07:49
netstat –apn |grep python
@an9er
an9er / aa
Created December 8, 2016 07:47
linux
=====
Created 星期二 17 五月 2016
#### 复制文件内容
cat ~/.ssh/id_rsa.pub | xclip -sel clip
#### find 命令查找文件
ll-proc-id
==========
Created 星期一 14 十一月 2016
#### 查看正在运行程序的路径
##### 命令
* ll /proc/PID
* ll /proc/PID/cwd
mysql
=====
Created 星期三 30 三月 2016
##### 数据库
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
@an9er
an9er / dd
Created December 8, 2016 01:30
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("www.douban.com") {
#db-nav-sns {
visibility: hidden;
height: 0px;
}
.global-nav {
visibility: hidden;
@an9er
an9er / 11-7
Created November 7, 2016 00:49
周末没有计划或者安排就是空过。
import socket
import sys
import random
from struct import pack
from struct import unpack
ROOMID = 58879
HOST, PORT = "dm.live.bilibili.com", 788
data = " ".join(sys.argv[1:])
_protocolversion = 1
// 将图片资源显示到页面中
function showImage(imageData) {
var reader = new FileReader();
reader.onload = function(e){
var img = new Image();
img.src = e.target.result;
document.body.appendChild(img);
};
// 读取图片文件
reader.readAsDataURL(imageData);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
#box{position: relative; width: 200px; height: 50px; border: 1px solid #eee; margin: 50px auto 0;}
#bg{height: 10px; margin-top: 19px; border: 1px solid #ddd; border-radius: 5px; overflow: hidden;}
#bgcolor{background: #5889B2; width: 0; height: 10px; border-radius: 5px;}
#bt{width: 34px; height: 34px; background: url(http://bbs.blueidea.com/data/attachment/album/201505/22/192934pwywwrt8cbrfwzfh.png) no-repeat center center; border-radius: 17px; overflow: hidden; position: absolute; left: 0px; margin-left: -17px; top: 8px; cursor: pointer;}