Skip to content

Instantly share code, notes, and snippets.

View imty42's full-sized avatar

Tianyu imty42

  • Beijing, China
View GitHub Profile
@imty42
imty42 / git-branch-rules.md
Created October 31, 2015 10:39
git 分支规范

主分支 master

  • master 为主分支,要保护它的稳定性,随时可用来上线。
  • 我们不应该直接在 master 分支上直接提交代码,而是从其它分支的合并。

开发分支 develop

  • develop 为开发分支,一般包含正在开发的所有新特性,用于测试环境部署和测试。
  • 我们不应该直接在 develop 分支上直接提交代码,也不应该把未经测试的代码合并进来,应该尽量保持测试环境干净可用。
  • 当 develop 太“脏”以至于不能继续测试之后,可以考虑重新从 master 拉取一次。
@imty42
imty42 / git-develop-workflow.md
Created October 31, 2015 10:44
GIT 开发流程

1. 初始化

git clone some-git-url proj-name
cd proj-name
git config --local user.name your.name
git config --local user.email your.email
git config --global core.editor vim

2. 创建新分支,请参考 [git 分支规范][1] “feature 分支命名规则”部分

git checkout develop

@imty42
imty42 / curl_file_upload.md
Last active November 30, 2015 04:30
php cUrl multipart form-data upload
$tmp_name = "";
$tmp_size = 0;
foreach ($_FILES as $v) {
  $tmp_name = $v["tmp_name"];
  $tmp_size = $v["size"];
}

$destination = "your_post_api_here";

if (class_exists('\CURLFile')) {

@imty42
imty42 / gist:3fb362dc3851c7580a27
Last active January 2, 2016 07:32 — forked from andphe/gist:3232343
Export your links from Safari reading list and open it with your Safari (may make your mac very hot, seriously!)
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'|xargs open -a Safari
const constructor = function(a, b) {
this.a = a;
this.b = b;
};
@imty42
imty42 / .tmux.conf
Last active October 30, 2016 06:23
My tmux config sharing.
unbind C-b
set -g prefix C-s
# bind a reload key
bind R source-file ~/.tmux.conf \; display-message "Config reloaded.."
# Use vim keybindings in copy mode
setw -g mode-keys vi
@imty42
imty42 / sVimrc
Last active April 13, 2019 06:59
Config for sVim extension for Safari
"" See https://github.com/flipxfx/sVim
let fullpagescrollpercent = 90
let hintcharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
map "ctrl+f" scrollFullPageDown
map "ctrl+b" scrollFullPageUp
map "ctrl+d" scrollPageDown
map "ctrl+u" scrollPageUp
@imty42
imty42 / .vimrc
Created May 15, 2017 02:38
A short config for Vim.
set nonumber
set showcmd
set fencs=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set expandtab
set tabstop=8
set shiftwidth=4
set softtabstop=4
set autoindent
@imty42
imty42 / aria2.conf
Last active January 6, 2020 13:59
aria2 config
## '#'开头为注释内容, 选项都有相应的注释说明, 根据需要修改 ##
## 被注释的选项填写的是默认值, 建议在需要修改时再取消注释 ##
## 初始化相关
# mkdir ~/.aria2
# touch ~/.aria2/aria2.session
# curl -O "https://gist.githubusercontent.com/hit1024/db49888f2dd198eee8c35dbbe3e00255/raw/f9f35caff9c59fc38eafda34cd189158301ec4c7/aria2.conf" ~/.aria2/aria2.conf
## 文件保存相关 ##
// 将设置放入此文件中以覆盖默认设置
{
"files.eol": "\n",
"editor.wordWrap": "on",
"workbench.startupEditor": "newUntitledFile",
"git.autofetch": false,
"window.zoomLevel": 0,
"python.pythonPath": "python2"
}