This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1、安装arcanist,clone源代码到安装目录somewhere/,arcanist依赖于libphutil,所以两个都要clone | |
somewhere/ git clone git://github.com/facebook/arcanist.git | |
somewhere/ git clone git://github.com/facebook/libphutil.git | |
2、配置arc,将arc加入到PATH,或在/usr/sbin里面建一个到arc的软链接 | |
export PATH=$PATH:/somewhere/arcanist/bin/ | |
或者:cd /usr/sbin; ln -sf /somewhere/arcanist/bin/arc | |
* 在系统的~/.bashrc或~/.bash_profile中加上该export语句。 | |
* 运行命令"arc help",来检测安装是否成功。 | |
3、配置arc的编辑器,不然会报错,提示EDITOR环境变量没配置 | |
arc set-config editor "vim" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sql-migrate工具 | |
工具:sql-migrate | |
https://github.com/rubenv/sql-migrate | |
模板:mysql代码库from公司 | |
http://git.yottabyte.cn/summary/mysql.git | |
Available commands are: | |
down Undo a database migration(只恢复一个) | |
redo Reapply the last migration | |
status Show migration status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xargs | |
问题:在管道命令 | 后面加不加xargs有什么区别? | |
区别: | |
管道是实现“将前面的标准输出作为后面的标准输入” | |
xargs是实现“将标准输入作为命令的参数” | |
例如, | |
echo "--help"|cat, 相当于 cat "--help", --help作为cat的标准输入流(STDIN) | |
echo "--help"|xargs cat 相当于 cat --help , --help作为cat的参数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://stackoverflow.com/questions/2836646/java-serializable-object-to-byte-array | |
ByteArrayOutputStream bos = new ByteArrayOutputStream(); | |
ObjectOutputStream out = null; | |
try { | |
out = new ObjectOutputStream(bos); | |
out.writeObject(yourObject); | |
out.flush(); | |
byte[] yourBytes = bos.toByteArray(); | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\r = CR (Carriage Return) // Used as a new line character in Mac OS before X | |
\n = LF (Line Feed) // Used as a new line character in Unix/Mac OS X | |
\r\n = CR + LF // Used as a new line character in Windows | |
So, | |
String lines[] = String.split("\\r?\\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object NullNotNone { | |
def main(args: Array[String]) { | |
test_func match { | |
case None => println("null is not none") | |
case Some(x) => println("so easy to be wrong") | |
} | |
} | |
def test_func: Option[java.lang.Double] = Some(null) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1、双引号 “” | |
完全匹配搜索,返回的结果包含双引号中出现的所有的词,连顺序也必须完全匹配。 | |
例如搜索: “seo方法图片” | |
2、减号 - | |
减号代表搜索不包含减号后面的词的页面。使用这个指令时减号前面必须是空格,减号后面没有空格,紧跟着需要排除的词。Google 和bd都支持这个指令。 | |
例如:搜索 -引擎 | |
返回的则是包含“搜索”这个词,却不包含“引擎”这个词的结果 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Java代码转换成Scala,常见的一些转换 | |
转换: | |
SomeType.class ==> classOf[SomeType] | |
Class<?> ==> def read[UnknowType](classes: Set[Class[UnknowType]]) | |
https://stackoverflow.com/questions/1135248/scala-equivalent-of-java-java-lang-classt-object | |
Java代码: | |
public Swagger read(Set<Class<?>> classes) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SSH的public_key和private_key | |
1、private_key [on your own PC] | |
Stored on the computer you log in from | |
2、public_key [on other PCs] | |
Stored on the .ssh/authorized_keys file on all the computers you want to log in to. | |
How it works ? | |
When you log in to a computer, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
改键工具:Karabiner | |
https://pqrs.org/osx/karabiner/ | |
改键博客: | |
http://tieba.baidu.com/p/3489459090 | |
http://www.jianshu.com/p/d8e59d432214 |
OlderNewer