Skip to content

Instantly share code, notes, and snippets.

View chrisyue's full-sized avatar
:octocat:
=。=

chris yue chrisyue

:octocat:
=。=
View GitHub Profile
@chrisyue
chrisyue / ctags-config-for-symfony2.md
Last active March 29, 2018 08:24
ctags-config-for-symfony
-R
--languages=php
--php-kinds=cif
--regex-php=/^[ \t]*trait[ \t]+([a-z0_9_]+)/\1/t,traits/i
--exclude=app/*
--exclude=bin/*
--exclude=web/*
--exclude=tests/*
--exclude=var/*
@chrisyue
chrisyue / han.md
Last active December 28, 2015 02:19
匹配UTF-8中文正则,php测试可用
/\p{Han}+/u

非汉字

/\P{Han}+/u

server {
server_name ~^(?<project>.*)\.localhost$;
root /var/www/repos/$project/web;
index app_dev.php;
location ~ \.php($|/) {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}

composer

http_proxy=http://127.0.0.1:8087 composer update

apt-get

http_proxy=http://127.0.0.1:8087 apt-get update

@chrisyue
chrisyue / ubuntu-ppa.md
Last active December 30, 2015 18:59
ubuntu 常用 ppa

command

sudo apt-add-repository [--remove] ppa:xx/xx
  • ppa:ondrej/php5
  • ppa:chris-lea/redis-server
  • ppa:git-core/ppa
  • vim ppa:fcwu-tw/ppa
  • ppa:chris-lea/node.js
@chrisyue
chrisyue / sonata-admin-default-filter.php
Created December 12, 2013 02:43
symfony sonata admin add default filter
public function getFilterParameters()
{
$default = [
'isAudited' => ['value' => 2],
];
$this->datagridValues = array_merge($default, $this->datagridValues);
return parent::getFilterParameters();
}
@chrisyue
chrisyue / diff.md
Created December 12, 2013 13:24
diff工具

vimdiff

vi -d file1 file2

meld(gui)

使用diff工具查看git本地与前版本不同之处

git difftool

@chrisyue
chrisyue / find.md
Created December 23, 2013 05:18
find命令查找文件

find [dir] -name [pattern]

@chrisyue
chrisyue / sed.md
Last active January 1, 2016 04:29
sed 多文件替换内容

sed -i s/old/new/g `grep old -lr dir`

@chrisyue
chrisyue / 淡墨秋山.md
Last active January 1, 2016 16:29
米芾(米南宫) - 淡墨秋山

淡墨秋山尽远天

暮霞还照紫添烟

故人好在重携手

不到平山谩五年