Skip to content

Instantly share code, notes, and snippets.

View liujingyu's full-sized avatar

jingyu liu liujingyu

View GitHub Profile

paste 逐行合并两个文件

  • -d 指定两个文件合并后每行之间的分隔符,如:
  • -d " " 以空格作为行之间的分隔符。
  • -d "\t" 以tab键作为行之间的分隔符。
  • -d "任意字符" 以"任意字符"作为行之间的分隔符。
  • -s paste one file at a time instead of in parallel

将合并后的行导入新文件中:

Git提交信息规范

每次提交,Commit message 都包括三个部分:Header,Body 和 Footer。

<type>(<scope>): <subject>
// 空一行
<body>
// 空一行
@liujingyu
liujingyu / Git:subtree.md
Last active June 17, 2017 08:54
Git subtree example

git subtree

  1. 添加子目录,建立与luka项目的关联。(--squash 禁止用)
git remote add -f content-console ssh://[email protected]:10022/php/content-console.git

git subtree add --prefix=ext/Content/Console content-console master
@liujingyu
liujingyu / Linux:batch.md
Last active June 17, 2017 08:58
Linux batch replace string

linux 批量操作

find . -name '*.php' | xargs perl -pi -e  's/BindedConstant/LingBinded/g'

Git delete tags

#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.

Git prune

大家帮忙想想办法让已经失效的远程 branch-name 在执行 git branch -a 的时候不再展示吧 清理远程分支,把本地不存在的远程分支删除

git remote prune origin

MySQL blob优化

首先,介绍下关于InnoDB引擎存储格式的几个要点:

1、InnoDB可以选择使用共享表空间或者是独立表空间方式,建议使用独立表空间,便于管理、维护。启用 innodb_file_per_table 选项,5.5以后可以在线动态修改生效,并且执行 ALTER TABLE xx ENGINE = InnoDB 将现有表转成独立表空间,早于5.5的版本,修改完这个选项后,需要重启才能生效;

2、InnoDB的data page默认16KB,5.6版本以后,新增选项 innodb_page_size 可以修改,在5.6以前的版本,只能修改源码重新编译,但并不推荐修改这个配置,除非你非常清楚它有什么优缺点;

3、InnoDB的data page在有新数据写入时,会预留1/16的空间,预留出来的空间可用于后续的新纪录写入,减少频繁的新增data page的开销;

@liujingyu
liujingyu / Git:log.md
Last active July 11, 2017 07:47
git full log

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative

@liujingyu
liujingyu / PHP:version.md
Last active July 11, 2017 07:45
PHP 在Mac上 多版本管理

mac php multi versions

brew install php-version
source $(brew --prefix php-version)/php-version.sh && php-version 7

example:

MySQL 名词解释

DDL 是Data Definition Language:它用于定义数据结构。

例如,使用SQL,它将是指令,如create table,alter table

DML是Data Manipulation Language:它用于操纵数据本身。

例如,使用SQL,它将是指令,如insert,update,delete