Skip to content

Instantly share code, notes, and snippets.

@jianghaoyuan2007
jianghaoyuan2007 / GitHub-Forking.md
Created September 13, 2018 06:24 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

联系方式

工作经历

北京沃趣互动科技有限公司 (2017/08 - 2017/12)

@jianghaoyuan2007
jianghaoyuan2007 / unit-tests.rb
Created February 27, 2018 11:44
The script of unit tests.
#!/usr/bin/env ruby
require 'xcodeproj'
require 'colored'
def insert_unit_testing_flag()
target_name = 'Your-Project-Name'
project_path = '../Your-Project-Name.xcodeproj'
unit_testing_identifier = "UNIT_TESTING"
symbol_identifier = "-D"
@jianghaoyuan2007
jianghaoyuan2007 / Optional+Extensions
Created December 4, 2017 06:55
The extensions for Optional type in Swift.
import Foundation
extension Optional {
var wrappedObject: Wrapped? {
if let object = self { return object }
return nil
}
@jianghaoyuan2007
jianghaoyuan2007 / URL+Extensions.swift
Last active September 27, 2022 07:37
The extensions for URL in Swift.
import Foundation
extension URL {
/// 返回不带有任何参数的 URL
/// let anURLString = "https://127.0.0.1:8080/search/index.html?type=ios&version=1.0"
/// let anURL = URL.init(string: anURLString)!
/// print(anURL.bareURL)
/// Optional(https://127.0.0.1:8080/search/index.html)
var bareURL: URL? {
@jianghaoyuan2007
jianghaoyuan2007 / git-stash.md
Created October 20, 2017 07:39 — forked from subchen/git-stash.md
Git Stash 用法

git stash用于保存和恢复工作进度

  • git stash

    保存当前的工作进度。会分别对暂存区和工作区的状态进行保存

  • git stash save "message..."

这条命令实际上是第一条 git stash 命令的完整版

@jianghaoyuan2007
jianghaoyuan2007 / Substrings.swift
Last active September 22, 2017 02:46
The example for getting substring of string with a range in Swift 4.
import Foundation
var greeting = "Hello, Swift 4."
let startIndexOffsetBy = 7
let endIndexOffsetBy = -1
let startIndex = greeting.index(greeting.startIndex, offsetBy: startIndexOffsetBy)
@jianghaoyuan2007
jianghaoyuan2007 / .gitignore
Created August 21, 2017 09:16
The example of .gitignore file.
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Ignore Mac DS_Store files
.DS_Store
## Build generated
build/
DerivedData/
@jianghaoyuan2007
jianghaoyuan2007 / .slate
Created May 9, 2017 03:32
My Slate Configuration.
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
# App Bindings
alias Alfred 'Alfred Preferences'
alias Kindle 'Kindle'
alias Charles 'Charles'
alias Dash 'Dash'
alias Xcode 'Xcode'
alias Finder 'Finder'
@jianghaoyuan2007
jianghaoyuan2007 / DateComponents.swift
Last active May 4, 2017 03:31
A Simple Date Component Example
import Foundation
let calendar = NSCalendar(calendarIdentifier: NSCalendar.Identifier.gregorian)
let units: NSCalendar.Unit = [.hour, .minute, .second]
let date = Date()
let dateComponents = calendar!.components(units, from: date)