Skip to content

Instantly share code, notes, and snippets.

View HugoWen's full-sized avatar

Hugo HugoWen

View GitHub Profile
@HugoWen
HugoWen / VimCommands.vim
Last active June 13, 2018 08:15
Vim Commands
G # 移到最后一行
yy # 复制一行
Y # 复制一行
p # 在当前行的下一行粘贴,并将光标移到被粘贴行的开头
P # 在当前行的上一行粘贴,并将光标移到被粘贴行的开头
0 # 光标移动到行首
$ # 光标移动到行尾
@HugoWen
HugoWen / CommonCommands.sh
Last active May 17, 2018 08:16
Linux/Mac Common Commands
tar czvf des.tar.gz des_dir # tar压缩目录
tar xzvf des.tar.gz # tar解压
pbcopy < des.txt # 复制文件内容
ps aux | grep nginx # 查找进程
@HugoWen
HugoWen / ExportCsv.php
Created August 10, 2017 07:54
php export csv file
function exportCSV($filename, $data)
{
header('Content-Encoding: UTF-8');
header('Content-type: text/csv; charset=UTF-8');
header("Content-Disposition:attachment;filename=".$filename);
header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
header('Expires:0');
header('Pragma:public');
echo "\xEF\xBB\xBF"; // UTF-8 BOM
echo $data;