Skip to content

Instantly share code, notes, and snippets.

View AllenCoder's full-sized avatar
💭
I may be slow to respond.

Allen AllenCoder

💭
I may be slow to respond.
  • Alibaba
  • Hangzhou, China
View GitHub Profile
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 != []:
-- 引言 --
Restful是一种非常优美的http接口设计风格及设计规范。使用restful原理来设计接口,可以非常显著地降低多个系统之间的耦合性,也可以使得接口变得非常一致,不仅美观,而且容易理解和上手。
然而在实际工作中,似乎很难真正用上完全的Restful,理想和现实总是有差距的- -
通过不断地实践归纳,结合restful的核心原理,我小结出了一套类Restful接口规范。它基本上解决了我在项目中遇到的90%的问题,自我感觉良好,哈哈。
-- 正文 --
== 请求/响应规范 ==
请求
GET: 使用url传参,如:?a=1&b=2
@AllenCoder
AllenCoder / git_toturial
Last active September 1, 2015 01:50 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
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://git@192.168.53.168/VT.git # clone远程仓库