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
git init # 初始化本地git仓库(创建新仓库) | |
git config --global user.name "xxx" # 配置用户名 | |
git config --global user.email "[email protected]" # 配置邮件 | |
git config --global color.ui true # git status等命令自动着色 | |
git config --global color.status auto | |
git config --global color.diff auto | |
git config --global color.branch auto | |
git config --global color.interactive auto | |
git config --global --unset http.proxy # remove proxy configuration on git | |
git clone git+ssh://[email protected]/VT.git # clone远程仓库 |
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
-- 引言 -- | |
Restful是一种非常优美的http接口设计风格及设计规范。使用restful原理来设计接口,可以非常显著地降低多个系统之间的耦合性,也可以使得接口变得非常一致,不仅美观,而且容易理解和上手。 | |
然而在实际工作中,似乎很难真正用上完全的Restful,理想和现实总是有差距的- - | |
通过不断地实践归纳,结合restful的核心原理,我小结出了一套类Restful接口规范。它基本上解决了我在项目中遇到的90%的问题,自我感觉良好,哈哈。 | |
-- 正文 -- | |
== 请求/响应规范 == | |
请求 | |
GET: 使用url传参,如:?a=1&b=2 |
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
from itertools import islice | |
def next_n_lines(file_opened, N): | |
return [x.strip() for x in islice(file_opened, N)] | |
with open("samplefile", 'r') as f: | |
x = "" | |
while x != []: |