注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。
启动新会话:
tmux [new -s 会话名 -n 窗口名]
恢复会话:
/* | |
This function will help you to convert your object from struct to map[string]interface{} based on your JSON tag in your structs. | |
Example how to use posted in sample_test.go file. | |
*/ | |
func structToMap(item interface{}) map[string]interface{} { | |
res := map[string]interface{}{} | |
if item == nil { | |
return res | |
} |
# Install tmux 2.8 on Centos | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel | |
# cd src | |
cd /usr/local/src | |
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
curl -LO https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz |
package main | |
import ( | |
"database/sql/driver" | |
"encoding/json" | |
"github.com/jinzhu/gorm" | |
_ "github.com/lib/pq" | |
) |
// Playbook - http://play.golang.org/p/3wFl4lacjX | |
package main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/base64" |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"mime/multipart" | |
"net/http" | |
"os" |
<?php | |
#source: http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-char | |
function replace_unicode_escape_sequence($match) { | |
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); | |
} | |
function unicode_decode($str) { | |
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', 'replace_unicode_escape_sequence', $str); | |
} |