haha

今天macbook pro 到了 心情大好
发个blog 纪念一哈
屌丝的电脑
哈哈哈

github fork a repo branch

link
I don’t know a native way yet, but you can do it following this recipe:

  • Fork the repository in question (called ‘upstream’) on the GitHub website to your workspace there.
  • Run the GitHub desktop application and clone the repository onto your PC.
  • Use the GitHub desktop application to open a shell in the repository. (The git commands are not available from the default PowerShell unless you configure that manually.)
  • Set the source repository as upstream:

    git remote add upstream https://github.com/{user}/{source-repo}.git
    
  • Fetch the full upstream repository. (Right now, you only have a copy of its master branch.)

    git fetch upstream
    
  • Make your file system copy the branch you want and give it any name:

    git checkout upstream/{branch-in-question}
    git checkout -b temporary
    
  • Publish your repo using the GitHub desktop application.

  • On the GitHub website, open your repository and click ‘settings’.

  • Change the “Default branch” to ‘temporary’. (Just change the drop-down menu, you don’t need to click the “Rename” button.)
  • Go back to your repository, go to the ‘branches’ tab, now you can delete the “master” branch.
  • Delete the master branch on your shell and make a new master branch:

    git branch -d master
    git branch master
    git checkout master
    git -d temporary
    
  • Once more, publish your repo using the GitHub desktop application.

  • On the GitHub website, open your repository and click ‘settings’.

  • Change the “Default branch” back to the (new) ‘master’ branch.
  • Go back to your repository, go to the ‘branches’ tab, now you can delete the “temporary” branch.

This should be what you were looking for. Perhaps GitHub will provide a more convenient way to do this in future (e.g., clicking “Fork” from a project’s branch results in exactly this behaviour).

git on google drive

link

  • Now, create a folder in your Google Drive folder called “git”. You want this folder as git produces a lot of files and you may want other stuff on your google drive besides your code repository.
1
mkdir \Users\JoeUser\Google Drive\git
  • CD yourself to your project folder (or whatever folder you want to have git control over).
1
cd \my-project-path
  • Now, in the projects folder, perform the following git commands
1
2
3
git init
git add .
git commit -m "first commit"
  • Now we go to Google Drive and create a bare git repo (note that the backslash between Google and Drive should be exactly there)
1
2
3
4
5
cd \Users\JoeUser\Google Drive\git
git init --bare my-project.git
cd \my-project-path
git remote add origin /Users/JoeUser/Google\ Drive/git/my-project.git
git push -u origin master
  • To checkout this project from another machine, you simply make sure you have google drive on that machine and type
1
2
cd /the_location_I_want_to_checkout_the_repo
git clone /Users/JoeUser/Google\ Drive/git/project1.git

iOS style guide

命名

0.文件命名

Tip
文件名须反映出其实现了什么类 – 包括大小写。遵循你所参与项目的约定。

类别的文件名应该包含被扩展的类名,如:GTMNSString+Utils.h 或GTMNSTextView+Autocomplete.h

1. 变量命名

Tip
方法名应该以小写字母开头,并混合驼峰格式。每个具名参数也应该以小写字母开头。

变量命名需要能明白两点

  • 变量意思
  • 变量类型

BOOL型

is开头

如:

//GOOD
BOOL isShouldReload;
BOOL isLoading;

//AVOID
BOOL k;

Array 型

s 结尾 或者 Array

如:

NSArray *users;
NSArray *messages

Dictionary

Dic 结尾 或服务器返回对象

NSDictionary *dateDic;
NSDictionary *message;

String

String 结尾 ,字段可以不用String 结尾

NSString *urlString;

@property (nonatomic,strong) NSString * topId;//尽量与服务器统一

UI Class

class 结尾 尽量不使用btn tv等简写

如:

//GOOD
UIButton *loginButton
UITextField *passwordTextField;

//AVOID
UIButton *login;
UITextField *password;

Block

on 开头

typedef void(^OnCompletion)(API *, id value);
typedef void(^OnFailed)(API *, id error);

OnCompletion  onCompletion;
OnFailed      onFailed;

2. 方法命名

fds

xcode errors


February 4, 2015

Showing first 200 notices only
静态库重复


Mach O Link Error- linker command failed with exit code 1 (use -v to see invocation)

link

1
"build active architecture only" to yes


E79CDDB501B68E74DDF03EA4E75246A7FDF010D0: no identity found Command /usr/bin/codesign failed with exit code 1

link

Xcode > Preferences > Accounts > View Details > And just refresh the Provisioning Profile


Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

将Apple LLVM compiler 4.2 - Language ->c++ Standard Library 修改为 libstdc++ (GNU C++ standard library)


Could not change executable permissions on the application.

Delete the app, restart iPhone

google addresses

—2014.10.23—

http://173.194.121.28/

https://github.com/bumaociyuan/wiki

—2014.09.26—

http://64.233.161.104

http://64.233.167.104

http://64.233.189.104/


美国 www.google.com image

中国大陆 www.google.cn image

hk www.google.com.hkimage

日本 www.google.co.jp image

沙特阿拉伯 www.google.com.sa

巴西 www.google.com.br

瑞士 www.google.ch

荷兰 www.google.nl image

澳大利亚 www.google.com.au

印度 www.google.co.in

罗马尼亚 www.google.ro

泰国 www.google.co.th

马来西亚 www.google.com.my

加拿大 www.google.ca

德国 www.google.de

墨西哥 www.google.com.mx

埃及 www.google.com.eg

智利 www.google.cl

以色列 www.google.co.il

法国 www.google.fr

土耳其 www.google.com.tr

希腊 www.google.gr

新加坡 www.google.com.sg

阿联酋 www.google.ae

中国台湾 www.google.com.tw

英国 www.google.co.uk

瑞典 www.google.se

波兰 www.google.pl

西班牙 www.google.es

阿根廷 www.google.com.ar

意大利 www.google.it

中国香港 www.google.com.hk

比利时 www.google.be

德国 www.google.de

法国 www.google.fr

英国 www.google.co.uk

日本特别行政区 www.google.co.jp

韩国 www.google.co.kr

意大利 www.google.it

瑞士 www.google.ch

加拿大 www.google.ca

以色列 www.google.co.il

荷兰 www.google.nl

比利时 www.google.be

智利 www.google.cl

阿根廷 www.google.com.ar

巴拿马 www.google.com.pa

奥地利 www.google.at

波兰 www.google.pl

俄罗斯 www.google.com.ru

巴西 www.google.com.br

新西兰 www.google.co.nz

维京群岛 www.google.vg

git note

download OSX latest git

init

git init

add remote url

git remote add origin repo-url

delete remote url

git remote rm origin

clone from remote

git clone repo-url

check status

git status

add all changes

git add .     #add all file in current folder
git add -A    #git

add some file

git add file-path

commit to repo

git commit -m 'comment'

remove all commits not in origin/master

git reset --hard origin/master

push to remote

git push 

log

git log                 #查看最近 提交
git log -10         #查看最近 提交 -10
git log --graph     #查看最近 提交 --graph
gitk                #GUI查看提交记录,需要用homebrew 升级git
gitk file-path        #GUI查看filefile-path提交记录

git log --decorate
git log --decorate --all --oneline --graph

checkout

git checkout .
git checkout <commit number> <filename>  #**常用**
git checkout 3f33b7959ff97715d69e418620895d98b811f8cb folder-name/* #恢复某folder-name下所有文件到 3f33b7959ff97715d69e418620895d98b811f8cb

撤销提交

git revert 

view branches

git branch             #查看本地分支
git branch -a         #查看本地和服务器分支

create new branch

git branch new-branch-name

switch branch

git checkout branch-name         #切换到branch-name

git merge from dev to master

git checkout master
git merge dev

delete branch

git branch -D branch-name                     #删除本地分支branch-name

git push origin --delete branch-name       #删除服务器分支branch-name

基于远程跟踪分支创建本地分支

git checkout --track -b branch-name-on-local origin/branch-name-on-server

diff

git diff master origin/master             # 比较 master(本地) 和服务器 master 的差异

push to server

git push origin branch-name-on-server

tag

git tag                                 #查看所有标签
git tag v0.1.2-light                    #创建轻量标签
git tag -a v0.1.2 -m “0.1.2版本”        #创建附注标签

git checkout tag-name
git tag -d v0.1.2                     #删除标签
git tag -a v0.1.1 9fbc3d0             #补打标签

git push --tags

通常的git push不会将标签对象提交到git服务器,我们需要进行显式的操作:

git push origin tag-name             #将tag-name标签提交到git服务器
git push origin –tags                 #将本地所有标签一次性提交到git服务器

push all

git push --all                         #push 所有branch
git push --all origin                 #push 所有tag 和所有branch到服务器

ruby change source

$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***

https://ruby.taobao.org
# 请确保只有 ruby.taobao.org
$ gem install rails

jekyll blog deploy github pages

document cn

Jekyll Introduction

sites using jekyll

github pages document

Host on GitHub in 3 Minutes

  1. Create a New Repository

    Go to your https://github.com and create a new repository named USERNAME.github.com

  1. install jekyll

    http://jekyllrb.com/

1
2
3
4
5
6
7
8
9
10
11
gem install jekyll
jekyll new my-awesome-site
cd my-awesome-site
jekyll serve
//Now browse to http://localhost:4000
cp my-awesome-site path/of/USERNAME.github.com
  1. Write .md file in _post dir
1
2
3
4
5
6
7
cd path/of/USERNAME.github.com
jekyll build
//auto create HTML file in _site dir
jekyll serve
//preview in port 4000

commit ur changes to github,visit USERNAME.github.io