Skip to content

Instantly share code, notes, and snippets.

View imty42's full-sized avatar

Tianyu imty42

  • Beijing, China
View GitHub Profile
@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
@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 / 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 / git-branch-rules.md
Created October 31, 2015 10:39
git 分支规范

主分支 master

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

开发分支 develop

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