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 branch branch_name | |
git checkout branch_name | |
# if something merged, if you don't want this things happen. you can use reset. | |
git reset branch_name --hard | |
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 remote add origin ssh://git@ip:8800/coz/coz3.git | |
git fetch | |
git add . | |
git commit |
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
给你一个列表,列表里的值都为整数,取出3个值相加为0的所有情况。保证取出来的值为不同组合,如 [1,2,3]已有,你可以取[3,2,1],但不能再取[1,2,3]. | |
result = [] | |
result_by_set = [] | |
l = [1,2,-1,3,-3,6,0] | |
for i, j in enumerate(l): | |
for m, n in enumerate(l[i+1:]): | |
for p in l[m+1:]: | |
if j + n + p == 0: |
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
# encoding: utf8 | |
# 正则表达式使用 | |
import re | |
# 首先编译你要查找的类型 | |
p = re.compile('\d+') | |
# 查看开始能否匹配到 | |
m = p.match("1233,4,bb,22") |
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
How to romote github's repository. | |
1.先保证你有github的账号,和你本地安装好了git, git --help如果成功的话就算已经安装好了。 | |
2.设置你是ssh key | |
进入到~apple/.ssh 目录下(如果没有创建一个), 执行ssh-keygen -t rsa命令, 期间会确认生成的文件名和提示输入密码的操作(你可以按照你自己设置), | |
最后会有2个文件生成, 分别是id_rsa,id_rsa.pub,打开github->setting下的SSH and GPG keys,新增一个SSH keys,把你的id_rsa.pub里的key添加到对应的空格中。 | |
3.本利连接上远端地址 | |
git remote origin add [email protected] | |
远端的地址你可以在仓库资源里的clone or download选项里面拷贝。 |